:root {
    --bg: #f2f3f3;
    --panel: #ffffff;
    --panel-soft: #f7f7f6;
    --ink: #2d2d2d;
    --muted: #6f7072;
    --line: #d9d9d7;
    --brand: #b41e28;
    --brand-strong: #8f1720;
    --accent: #b8975a;
    --danger: #9f2b30;
    --ok: #26734d;
    --warn: #b77916;
    --shadow: 0 8px 24px rgba(45, 45, 45, .07);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    background: var(--bg);
    font-family: Lato, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 18px;
    border-top: 5px solid var(--brand);
    border-right: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.brand {
    padding: 0 4px 18px;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.brand-logo-frame {
    display: flex;
    min-height: 132px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: #fff;
}

.brand-logo {
    display: block;
    height: auto;
}

.brand-logo-square {
    width: min(132px, 100%);
}

.brand-logo-wide {
    width: min(210px, 100%);
    padding: 15px;
    border-radius: 6px;
    background: #2d2d2d;
}

.brand-subtitle {
    margin-top: 8px;
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 700;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 7px;
    color: #404040;
    font-weight: 650;
}

.nav a:hover,
.nav a.active {
    background: #f8e9ea;
    color: var(--brand-strong);
}

.nav a.active {
    background: var(--brand);
    color: #fff;
}

.user-box {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.main {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.area-label {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.topbar-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.global-search {
    display: flex;
    gap: 6px;
    min-width: min(440px, 100%);
}

.global-search input {
    min-width: 230px;
}

.changelog-preview {
    margin: 0 0 22px;
    padding: 14px 16px;
    border: 1px solid #d9c9a8;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: #fffdf7;
}

.transient-update {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 30;
    width: min(440px, calc(100vw - 36px));
    max-height: min(70vh, 560px);
    margin: 0;
    overflow: auto;
    box-shadow: 0 18px 42px rgba(42, 36, 28, .18);
    animation: update-toast-in .18s ease-out;
}

.transient-update.is-dismissed {
    display: none;
}

.toast-close {
    min-width: 34px;
    padding-inline: 9px;
}

@keyframes update-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.changelog-preview-head,
.feedback-entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.changelog-preview-head h2 {
    margin: 0;
    font-size: 17px;
}

.changelog-preview-list,
.changelog-list,
.feedback-list {
    display: grid;
    gap: 0;
}

.changelog-entry {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.changelog-entry:last-child {
    border-bottom: 0;
}

.changelog-entry h3 {
    margin: 7px 0 5px;
    font-size: 16px;
}

.changelog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

.changelog-meta strong {
    color: var(--brand-strong);
}

.changelog-body,
.feedback-description {
    white-space: normal;
    overflow-wrap: anywhere;
}

.changelog-author {
    margin-top: 8px;
    font-size: 12px;
}

.feedback-entry {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.feedback-entry:last-child {
    border-bottom: 0;
}

.feedback-description {
    margin: 12px 0 8px;
}

.feedback-note {
    margin-top: 10px;
    padding: 9px 11px;
    border-left: 3px solid var(--brand);
    background: var(--panel-soft);
}

.feedback-update-form {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(120px, auto) minmax(160px, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
}

.feedback-update-form input,
.feedback-update-form select {
    width: 100%;
}

.backup-checks {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.backup-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

.backup-details {
    display: grid;
    grid-template-columns: minmax(145px, 190px) 1fr;
    gap: 10px 16px;
    margin: 0 0 18px;
}

.backup-details dt {
    color: var(--muted);
}

.backup-details dd {
    margin: 0;
}

.backup-note {
    margin: 14px 0 0;
}

.scanner-pill,
.user-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.page-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: 0;
    font-family: "Droid Serif", Georgia, serif;
    font-weight: 500;
}

.page-note {
    margin: 6px 0 0;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-soft);
}

.panel-title {
    margin: 0;
    font-size: 16px;
    font-family: "Droid Serif", Georgia, serif;
    font-weight: 600;
}

.panel-body {
    padding: 16px;
}

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

.booking-form {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.booking-title {
    grid-column: span 12;
    margin: 0;
    font-size: 18px;
}

.booking-in .booking-title {
    color: var(--ok);
}

.booking-out .booking-title {
    color: var(--danger);
}

.stat {
    display: grid;
    gap: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 0;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

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

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

th,
td {
    padding: 10px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: #4b4942;
    background: #f2f0ea;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

tr.low-stock td {
    background: #fff8df;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
}

.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field.span-4 { grid-column: span 4; }
.field.span-5 { grid-column: span 5; }
.field.span-6 { grid-column: span 6; }
.field.span-8 { grid-column: span 8; }
.field.span-9 { grid-column: span 9; }
.field.span-12 { grid-column: span 12; }

label {
    color: #4f4d45;
    font-size: 13px;
    font-weight: 650;
}

.field-help {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 12px;
}

.material-item-suggestion-note {
    display: block;
    min-height: 17px;
    margin-top: 3px;
    color: var(--muted);
}

.material-item-suggestion-note.is-success {
    color: var(--success, #23815d);
    font-weight: 650;
}

.material-request-overview .table-wrap {
    overflow-x: auto;
}

.material-procurement-form {
    display: grid;
    min-width: 260px;
    gap: 6px;
}

.material-procurement-form input,
.material-procurement-form select {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 12px;
}

.material-procurement-form .btn {
    justify-self: start;
}

.help-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
}

.help-flow span {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #faf9f5;
}

.help-flow strong {
    color: var(--brand);
}

.help-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--accent, #b8975a);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.help-flow span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.help-flow span b {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
}

.help-quick-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.help-quick-card {
    position: relative;
    display: grid;
    min-height: 112px;
    align-content: start;
    gap: 7px;
    padding: 15px 14px 14px 42px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 7px;
    background: var(--panel-soft);
    color: var(--ink);
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.help-quick-card:hover,
.help-quick-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--brand);
    box-shadow: 0 8px 18px rgba(27, 37, 47, .1);
}

.help-quick-card strong {
    font-size: 14px;
}

.help-quick-card > span:last-child {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.help-quick-arrow {
    position: absolute;
    top: 15px;
    left: 13px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

.help-quick-blue { border-left-color: #3d76c9; }
.help-quick-gold { border-left-color: #b8975a; }
.help-quick-green { border-left-color: #2e8b68; }
.help-quick-red { border-left-color: #b41e28; }

.help-roles-panel .panel-body {
    padding-top: 4px;
}

.help-role-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.help-role-card {
    min-height: 170px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
}

.help-role-card h3 {
    margin: 12px 0 7px;
    color: var(--ink);
    font-size: 16px;
}

.help-role-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.help-role-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e7edf7;
    color: #315f9f;
    font-size: 11px;
    font-weight: 800;
}

.help-role-gold { background: #f3ead7; color: #85652b; }
.help-role-green { background: #e4f2eb; color: #287455; }
.help-role-red { background: #f7e4e5; color: #a01f2a; }

.help-steps,
.help-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 22px;
}

.help-steps li::marker {
    color: var(--brand);
    font-weight: 800;
}

.help-list {
    padding-left: 18px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid #cac6bb;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
}

textarea {
    min-height: 88px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(180, 30, 40, .18);
    border-color: var(--brand);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    background: var(--brand-strong);
}

.btn.secondary {
    background: #fff;
    color: var(--ink);
    border-color: #c9c5ba;
}

.btn.secondary:hover {
    background: #f2f0ea;
}

.btn.danger {
    background: var(--danger);
}

.btn.warn {
    background: var(--accent);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ece9df;
    color: #4b4942;
    font-size: 12px;
    font-weight: 750;
}

.badge.ok { background: #dff1e5; color: #1f603b; }
.badge.warn { background: #fff1c9; color: #76510c; }
.badge.danger { background: #f8dfdc; color: #862e28; }
.badge.info { background: #dfece9; color: #244f43; }

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.flash.ok {
    border-color: #b9dfc5;
    background: #edf8f0;
}

.flash.error {
    border-color: #e6bbb7;
    background: #fff0ee;
}

.split-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    border-top: 6px solid var(--brand);
    background: var(--bg);
}

.login-stack {
    display: grid;
    justify-items: center;
    width: min(760px, 100%);
}

.login-branding {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: 100%;
    margin-bottom: 18px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.login-brand-primary,
.login-brand-workshop {
    display: grid;
    justify-items: center;
    text-align: center;
    align-content: center;
    min-height: 220px;
}

.login-brand-primary img,
.login-brand-workshop img {
    width: min(190px, 100%);
    height: 190px;
    object-fit: contain;
}

.login-brand-divider {
    width: 1px;
    height: 126px;
    background: var(--line);
}

.login-brand-workshop {
    gap: 5px;
}

.login-brand-workshop img {
    padding: 8px;
    border-radius: 6px;
    background: #2d2d2d;
}

.login-brand-center {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: 4px;
    padding-top: 2px;
    text-align: center;
}

.login-brand-center strong {
    color: var(--brand-strong);
    font-family: "Droid Serif", Georgia, serif;
    font-size: 24px;
    line-height: 1.2;
}

.login-brand-center small {
    color: var(--muted);
    font-size: 14px;
}

.login-panel {
    width: min(440px, 100%);
}

.lift-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.lift-tile {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--line);
    border-radius: 8px;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}

.lift-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(40, 39, 35, .12);
}

.lift-tile-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.lift-status-frei { border-left-color: var(--ok); }
.lift-status-belegt { border-left-color: var(--danger); }
.lift-status-reserviert { border-left-color: var(--warn); }
.lift-status-wartung,
.lift-status-gesperrt { border-left-color: var(--accent); }

.lift-tile .badge {
    flex: 0 0 auto;
}

.lift-tile strong {
    display: block;
    font-family: "Droid Serif", Georgia, serif;
    font-size: 17px;
}

.lift-assignment {
    min-height: 58px;
    margin: 4px 0 12px;
}

.lift-assignment strong {
    margin-bottom: 3px;
    font-family: inherit;
    font-size: 15px;
}

.lift-details {
    display: grid;
    gap: 7px;
    margin: 0 0 14px;
}

.lift-detail {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
}

.lift-detail dt {
    color: var(--muted);
    font-size: 12px;
}

.lift-detail dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 700;
}

.lift-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
}

.lift-actions form {
    margin: 0;
}

.lift-actions .btn {
    width: 100%;
    height: 100%;
}

.berlin-clock {
    margin-left: auto;
    border-color: #d6b8bb !important;
    background: #fff !important;
}

.workshop-statusbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.workshop-statusbar span {
    min-width: 104px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    font-size: 13px;
}

.workshop-statusbar strong {
    display: inline;
    color: var(--brand-strong);
}

.muted {
    color: var(--muted);
}

.nowrap {
    white-space: nowrap;
}

@media (max-width: 980px) {
    .app-shell {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        overflow-x: hidden;
    }

    .sidebar {
        position: static;
        height: auto;
        min-width: 0;
    }

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

    .main {
        padding: 18px;
    }

    .topbar {
        display: grid;
    }

    .topbar-tools {
        justify-content: flex-start;
    }

    .global-search {
        width: 100%;
        min-width: 0;
    }

    .global-search input {
        min-width: 0;
    }

    .feedback-update-form {
        grid-template-columns: 1fr 1fr;
    }

    .feedback-update-form input {
        grid-column: span 2;
    }

    .login-branding {
        gap: 12px;
    }

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

    .span-3,
    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-9,
    .span-12,
    .field.span-2,
    .field.span-3,
    .field.span-4,
    .field.span-5,
    .field.span-6,
    .field.span-8,
    .field.span-9,
    .field.span-12 {
        grid-column: span 12;
    }

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

@media (max-width: 600px) {
    .sidebar {
        gap: 10px;
        padding: 10px 12px;
    }

    .nav {
        display: flex;
        gap: 6px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .nav a {
        flex: 0 0 auto;
        min-height: 38px;
        white-space: nowrap;
    }

    .brand {
        padding-bottom: 8px;
    }

    .brand-subtitle,
    .user-box {
        display: none;
    }

    .main {
        padding: 12px;
    }

    .page-title {
        font-size: 24px;
    }

    .topbar-tools,
    .global-search {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .global-search input,
    .global-search .btn,
    .scanner-pill,
    .user-pill {
        width: 100%;
    }

    .scanner-pill,
    .user-pill {
        white-space: normal;
    }

    .panel-head,
    .changelog-preview-head,
    .feedback-entry-head {
        flex-direction: column;
        align-items: stretch;
    }

    .feedback-update-form {
        grid-template-columns: 1fr;
    }

    .feedback-update-form input {
        grid-column: span 1;
    }

    .login-screen {
        padding: 12px;
    }

    .login-branding {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        width: 100%;
        padding: 16px;
    }

    .login-brand-divider {
        display: none;
    }

    .login-brand-primary,
    .login-brand-workshop {
        min-height: 0;
    }

    .login-brand-primary img,
    .login-brand-workshop img {
        width: min(160px, 100%);
        height: 160px;
    }

    .login-brand-center {
        grid-column: 1 / -1;
    }

    .login-brand-center strong {
        font-size: 21px;
    }

    .brand-logo-frame {
        min-height: 68px;
    }

    .brand-logo-square {
        width: min(64px, 100%);
    }

    .brand-logo-wide {
        width: min(180px, 100%);
        padding: 9px;
    }

    .backup-details {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

/* Die Werkstatt follows the dark-and-blue colors of its own sign. */
body.workshop-area {
    --bg: #edf1f8;
    --panel: #ffffff;
    --panel-soft: #f4f6fb;
    --ink: #252a33;
    --muted: #687180;
    --line: #d6ddea;
    --brand: #3266c1;
    --brand-strong: #1e376c;
    --accent: #7195df;
    --danger: #b9434a;
    --ok: #2f8264;
    --warn: #be8c28;
    --shadow: 0 8px 24px rgba(27, 43, 74, .10);
}

body.workshop-area .sidebar {
    border-top-color: #4d83e2;
    border-right-color: #273449;
    background: #151a23;
    color: #f4f7ff;
}

body.workshop-area .brand {
    border-bottom-color: rgba(210, 225, 255, .18);
}

body.workshop-area .brand-logo-frame {
    background: #151a23;
}

body.workshop-area .brand-logo-wide {
    background: #0b0e14;
    box-shadow: 0 0 0 1px rgba(103, 145, 228, .45);
}

body.workshop-area .brand-subtitle {
    color: #9db9f2;
}

body.workshop-area .nav a {
    color: #d6deef;
}

body.workshop-area .nav a:hover {
    background: rgba(86, 130, 215, .18);
    color: #fff;
}

body.workshop-area .nav a.active {
    background: #3266c1;
    color: #fff;
}

body.workshop-area .user-box {
    border-top-color: rgba(210, 225, 255, .18);
    color: #b7c4dc;
}

body.workshop-area .panel-head {
    background: #f0f4fb;
}

body.workshop-area .panel-title,
body.workshop-area .page-title {
    color: #1e376c;
}

body.workshop-area .btn {
    background: #3266c1;
}

body.workshop-area .btn:hover {
    background: #1e376c;
}

body.workshop-area .btn.secondary {
    color: #1e376c;
    border-color: #b8c6df;
    background: #fff;
}

body.workshop-area .btn.secondary:hover {
    background: #eaf0fb;
}

body.workshop-area input:focus,
body.workshop-area select:focus,
body.workshop-area textarea:focus {
    outline-color: rgba(50, 102, 193, .22);
    border-color: #3266c1;
}

body.workshop-area .changelog-preview {
    border-color: #b8c8e4;
    border-left-color: #3266c1;
    background: #f7f9fd;
}

body.workshop-area .workshop-statusbar span {
    border-color: #c5d0e4;
    background: #f7f9fd;
}

body.workshop-area .workshop-statusbar strong {
    color: #1e376c;
}

body.workshop-area .berlin-clock {
    border-color: #7195df !important;
    background: #e9effb !important;
}

body.workshop-area .badge.info {
    background: #e3ebfb;
    color: #1e376c;
}

body.workshop-area .badge.ok {
    background: #dff2e9;
    color: #21634d;
}

body.workshop-area .badge.warn {
    background: #fff1c9;
    color: #76510c;
}

body.workshop-area .badge.danger {
    background: #f8dfdf;
    color: #8d3036;
}

.invoice-created .panel-body {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.invoice-created .panel-body span {
    color: var(--muted);
}

.quick-link-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.quick-link {
    display: grid;
    gap: 5px;
    min-height: 104px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
}

.quick-link:hover {
    border-color: var(--brand);
    background: var(--panel);
}

.quick-link strong {
    color: var(--brand-strong);
}

.quick-link span {
    color: var(--muted);
    font-size: 13px;
}

.assignment-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.assignment-card-grid > div {
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 82px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
}

.assignment-card-grid strong,
.assignment-card-grid .muted {
    overflow-wrap: anywhere;
}

.assignment-card-grid strong {
    color: var(--brand-strong);
}

.invoice-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.invoice-kpis > div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
}

.invoice-kpis strong {
    color: var(--brand-strong);
    font-size: 20px;
}

.invoice-kpis span,
.cashier-action span,
.invoice-summary span {
    color: var(--muted);
}

.cashier-action {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px;
    border-left: 4px solid var(--brand);
    background: var(--panel-soft);
}

.cashier-action > div {
    display: grid;
    gap: 4px;
}

.inline-form {
    display: inline-flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form .field {
    margin: 0;
}

.inline-form label {
    display: block;
}

.invoice-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.invoice-summary > div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
}

.text-right {
    text-align: right;
}

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

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

@media (max-width: 760px) {
    .invoice-kpis,
    .invoice-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 480px) {
    .invoice-kpis,
    .invoice-summary {
        grid-template-columns: 1fr;
    }
}

/* Packlisten und druckbare Vorlagen */
.form-section-title {
    margin-top: 6px;
    padding: 9px 0 7px;
    border-bottom: 2px solid var(--line);
    color: var(--brand-strong);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .02em;
}

.scanner-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-form input {
    flex: 1 1 260px;
    min-width: 0;
}

.scanner-form .btn {
    flex: 0 0 auto;
}

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

.scanner-step {
    display: grid;
    align-content: start;
    gap: 13px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand);
    border-radius: 8px;
    background: var(--panel-soft);
}

.scanner-step-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-step-head h3 {
    margin: 0;
    font-size: 16px;
}

.scanner-step-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.scanner-step-number {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    flex: 0 0 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
}

.scanner-item-preview {
    display: grid;
    gap: 12px;
    padding: 13px;
    border: 1px solid #b9d9c7;
    border-radius: 7px;
    background: #f5fbf7;
}

.scanner-item-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.scanner-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.scanner-detail-grid > div {
    min-width: 0;
}

.scanner-detail-grid dt,
.scanner-detail-grid dd {
    margin: 0;
}

.scanner-detail-grid dt,
.scanner-readonly-field span,
.scanner-context-summary .meta-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.scanner-detail-grid dd {
    overflow-wrap: anywhere;
    font-weight: 700;
}

.scanner-stock-value {
    padding: 9px 10px;
    border: 1px solid #e4c773;
    border-radius: 6px;
    background: #fff8dc;
}

.scanner-stock-value dd {
    color: #785b00;
    font-size: 18px;
}

.scanner-empty-state,
.scanner-readonly-field,
.scanner-context-summary {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.scanner-readonly-field strong,
.scanner-context-summary strong {
    overflow-wrap: anywhere;
}

.scanner-or {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.scanner-or::before,
.scanner-or::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--line);
}

.scanner-confirm-step {
    border-top-color: var(--ok);
}

.scanner-confirm-step .btn:disabled,
.scanner-quantity-form .btn:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.scanner-validation-note {
    min-height: 18px;
    color: var(--muted);
    font-size: 12px;
}

.scanner-footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.history-search {
    max-width: 760px;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table-wrap table {
    min-width: 1180px;
}

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

@media (max-width: 560px) {
    .scanner-form,
    .scanner-footer-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scanner-form .btn,
    .scanner-footer-actions .btn {
        width: 100%;
    }

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

.job-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.job-meta-grid > div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}

.job-meta-grid span {
    color: var(--muted);
    font-size: 12px;
}

.job-meta-grid strong {
    overflow-wrap: anywhere;
}

.barcode-actions,
.catalog-print-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.barcode-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.barcode-inline svg {
    width: 150px;
    height: 36px;
}

.procurement-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.procurement-form .wide {
    grid-column: span 2;
}

.invoice-footer {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.invoice-footer img {
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.invoice-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 auto 16px;
    width: min(210mm, 100%);
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, 100%);
    box-sizing: border-box;
    margin: auto auto 0;
    padding: 18px 24px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.template-editor {
    width: 100%;
    box-sizing: border-box;
    min-height: 260px;
    padding: 14px;
    border: 1px solid #2e4052;
    border-radius: 6px;
    background: #111a24;
    color: #e8eff7;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
    tab-size: 2;
}

.template-editor:focus {
    border-color: var(--accent);
    outline: 2px solid rgba(51, 105, 194, .22);
}

.visual-editor {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9fc;
}

.visual-editor-head,
.visual-editor-actions,
.visual-template-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.visual-editor-head {
    justify-content: space-between;
    margin-bottom: 14px;
}

.visual-editor-head h3 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 17px;
}

.visual-editor-head .page-note {
    margin: 0;
}

.visual-editor-board {
    display: grid;
    gap: 8px;
}

.visual-template-block {
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: grab;
    transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.visual-template-block:active {
    cursor: grabbing;
}

.visual-template-block.is-dragging {
    opacity: .5;
}

.visual-template-block.is-drag-target {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(51, 105, 194, .14);
}

.visual-template-drag {
    flex: 0 0 26px;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
}

.visual-template-copy {
    display: grid;
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
}

.visual-template-copy strong {
    color: var(--ink);
}

.visual-template-copy span {
    color: var(--muted);
    font-size: 12px;
}

.visual-template-toggle {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--ink);
    font-size: 12px;
}

.visual-template-controls {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.visual-template-controls .btn {
    min-width: 54px;
    padding: 7px 9px;
    font-size: 12px;
}

.element-insert-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 10px;
    padding: 10px;
    border: 1px dashed #b8c4d3;
    border-radius: 6px;
    background: #eef3f8;
}

.element-insert-bar strong {
    margin-right: 4px;
    color: var(--ink);
}

.visual-element-card {
    flex-wrap: wrap;
    align-items: flex-start;
}

.visual-element-card .visual-template-copy {
    padding-top: 2px;
}

.visual-element-editor {
    flex: 1 1 100%;
    margin: 10px 0 0 40px;
    padding-top: 10px;
    border-top: 1px solid #e0e7ef;
}

.element-field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 9px;
}

.element-field-grid label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
}

.element-field-grid .element-content-field {
    grid-column: span 4;
}

.element-field-grid .element-content-field textarea {
    min-height: 58px;
    resize: vertical;
}

.element-field-grid input,
.element-field-grid select,
.element-field-grid textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.element-field-grid input[type="color"] {
    min-height: 34px;
    padding: 3px;
}

.element-field-grid .element-check {
    display: flex;
    align-items: center;
    align-self: end;
    min-height: 34px;
    gap: 6px;
    color: var(--ink);
    font-size: 12px;
}

.element-field-grid .element-check input {
    width: auto;
}

.invoice-custom-text,
.invoice-custom-heading,
.invoice-custom-box {
    box-sizing: border-box;
    width: 100%;
}

.invoice-custom-heading {
    margin: 12px 0;
}

.invoice-custom-box {
    margin: 12px 0;
}

.invoice-custom-line {
    width: 100%;
}

.invoice-custom-spacer {
    width: 100%;
}

.packlist-paper {
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 16mm;
    background: #fff;
    color: #20252b;
    box-shadow: 0 5px 22px rgba(24, 38, 56, .16);
}

.packlist-paper .visual-invoice-meta {
    display: grid;
    justify-items: start;
    gap: 4px;
    margin: 18px 0;
    text-align: left;
}

.packlist-paper .visual-invoice-meta h1 {
    margin: 0;
    font-size: 25px;
}

.packlist-paper .invoice-paper-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin: 18px 0;
}

.packlist-paper .invoice-paper-parties section,
.packlist-paper .invoice-extra-block {
    display: grid;
    gap: 5px;
}

.packlist-paper .invoice-lines {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 12px;
}

.packlist-paper .invoice-lines th,
.packlist-paper .invoice-lines td {
    padding: 8px;
    border-bottom: 1px solid #d9dee4;
    text-align: left;
    vertical-align: top;
}

.packlist-paper .invoice-lines th {
    background: #1f5b45;
    color: #fff;
}

.packlist-paper .invoice-label {
    color: #697586;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.packlist-paper .invoice-extra-block {
    margin: 18px 0;
    padding: 10px 12px;
    border: 1px solid #d9dee4;
    border-radius: 4px;
}

.packlist-paper .invoice-paper-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 34px;
    padding-top: 10px;
    border-top: 1px solid #d9dee4;
    font-size: 10px;
}

.visual-editor-actions {
    justify-content: space-between;
    margin-top: 12px;
}

.advanced-editor {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 14px;
    background: #fbfcfe;
}

.advanced-editor summary {
    cursor: pointer;
    color: var(--ink);
    font-weight: 700;
}

.advanced-editor-body {
    display: grid;
    gap: 10px;
    padding-top: 14px;
}

.visual-invoice-meta {
    display: grid;
    gap: 6px;
    justify-items: end;
    padding: 18px 0;
    border-bottom: 1px solid #d9dee4;
    text-align: right;
}

.visual-invoice-meta h1 {
    margin: 0;
    color: #142d52;
    font-size: 26px;
}

.designer-page {
    width: min(1480px, 100%);
    margin: 0 auto;
}

.designer-page-head,
.designer-preview-head,
.designer-sidebar-head,
.designer-sidebar-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.designer-page-head {
    margin-bottom: 18px;
}

.designer-page-head .page-note,
.designer-preview-head span,
.designer-sidebar-head span {
    color: var(--muted);
    font-size: 13px;
}

.designer-page-head .panel-title,
.designer-preview-head h3,
.designer-sidebar-head h3 {
    margin: 0 0 4px;
}

.designer-form {
    display: block;
}

.designer-workspace {
    display: grid;
    grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.designer-sidebar,
.designer-preview-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9fc;
}

.designer-sidebar {
    position: sticky;
    top: 18px;
}

.designer-sidebar-head {
    align-items: flex-start;
    margin-bottom: 16px;
}

.designer-style-controls {
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid #d5dde7;
    border-radius: 6px;
    background: #fff;
}

.designer-style-controls h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 14px;
}

.designer-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.designer-style-grid label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.designer-style-grid label:nth-child(n + 5) {
    grid-column: 1 / -1;
}

.designer-style-grid input[type="color"] {
    width: 100%;
    height: 36px;
    padding: 2px;
}

.designer-style-grid input[type="range"] {
    width: 100%;
}

.designer-style-grid output {
    float: right;
    color: var(--ink);
    font-weight: 700;
}

.invoice-extra-block {
    display: grid;
    gap: 5px;
    margin-top: 18px;
    padding: 12px 14px;
    border-left: 4px solid #d9dee4;
    background: #f7f9fc;
}

.invoice-extra-block p {
    margin: 0;
}

.designer-sidebar-foot {
    align-items: stretch;
    flex-direction: column;
    margin-top: 16px;
}

.designer-sidebar-foot .btn {
    width: 100%;
}

.designer-preview-head {
    align-items: flex-start;
    margin-bottom: 16px;
}

.designer-preview-canvas {
    min-height: 640px;
    overflow: auto;
    padding: 18px;
    background: #dfe5ec;
}

.designer-preview-canvas .invoice-paper {
    transform-origin: top left;
}

.visual-template-source {
    display: none;
}

.job-workflow-step {
    border-left: 4px solid var(--accent);
}

.invoice-paper {
    box-sizing: border-box;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 17mm 16mm 14mm;
    background: #fff;
    color: #20252b;
    box-shadow: 0 10px 34px rgba(25, 34, 44, .16);
}

.invoice-paper-header {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 18px;
    border-bottom: 3px solid #142d52;
}

.invoice-paper-brand {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.invoice-paper-brand img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    flex: 0 0 auto;
}

.invoice-paper-brand > div,
.invoice-paper-title,
.invoice-paper-parties section,
.invoice-totals,
.invoice-thankyou {
    display: grid;
    gap: 5px;
}

.invoice-paper-brand strong {
    color: #142d52;
    font-size: 16px;
}

.invoice-paper-brand span,
.invoice-paper-title span,
.invoice-paper-parties span,
.invoice-paper-footer span,
.invoice-thankyou span {
    color: #5c6874;
    font-size: 12px;
}

.invoice-paper-title {
    min-width: 178px;
    align-content: start;
    text-align: right;
}

.invoice-paper-title h1 {
    margin: 0 0 4px;
    color: #142d52;
    font-size: 28px;
    letter-spacing: .04em;
}

.invoice-paper-title strong {
    font-size: 13px;
}

.invoice-paper-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0 26px;
    padding: 14px 0;
    border-bottom: 1px solid #d9dee4;
}

.invoice-label {
    color: #687581 !important;
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.invoice-paper-parties strong {
    font-size: 14px;
}

.invoice-lines {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.invoice-lines th,
.invoice-lines td {
    padding: 9px 7px;
    border-bottom: 1px solid #e1e5e9;
    text-align: right;
    vertical-align: top;
}

.invoice-lines th:first-child,
.invoice-lines td:first-child {
    text-align: left;
}

.invoice-lines th {
    background: #142d52;
    color: #fff;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.invoice-paper-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 32px;
    align-items: end;
    margin-top: 28px;
}

.invoice-thankyou {
    align-self: end;
}

.invoice-thankyou strong {
    color: #142d52;
    font-size: 14px;
}

.invoice-totals {
    justify-items: end;
    font-size: 12px;
}

.invoice-totals > span {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}

.invoice-total {
    width: 100%;
    margin-top: 5px;
    padding: 10px 12px;
    box-sizing: border-box;
    background: #142d52;
    color: #fff;
    font-size: 14px;
}

.invoice-paper-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 34px;
    padding-top: 10px;
    border-top: 1px solid #d9dee4;
}

@media (max-width: 760px) {
    .app-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-inline: 16px;
    }

    .visual-editor-head,
    .visual-editor-actions,
    .visual-template-block {
        align-items: stretch;
        flex-direction: column;
    }

    .visual-template-block {
        align-items: flex-start;
    }

    .visual-template-drag {
        display: none;
    }

    .visual-element-editor {
        margin-left: 0;
    }

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

    .element-field-grid .element-content-field {
        grid-column: span 2;
    }

    .visual-template-controls,
    .visual-template-controls .btn {
        width: 100%;
    }

    .visual-template-controls .btn {
        flex: 1;
    }

    .designer-page-head,
    .designer-preview-head,
    .designer-sidebar-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .designer-sidebar {
        position: static;
    }

    .designer-preview-canvas {
        padding: 8px;
    }

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

    .designer-style-grid label:nth-child(n + 5) {
        grid-column: auto;
    }

    .designer-preview-canvas .invoice-paper {
        transform: scale(.68);
        transform-origin: top left;
        margin-bottom: -260px;
    }

    .invoice-preview-actions {
        width: 100%;
        justify-content: stretch;
    }

    .invoice-preview-actions .btn {
        flex: 1;
        text-align: center;
    }

    .invoice-paper {
        width: 100%;
        min-height: 0;
        padding: 22px 16px;
    }

    .packlist-paper {
        width: 100%;
        min-height: 0;
        padding: 22px 16px;
    }

    .invoice-paper-header,
    .invoice-paper-parties,
    .invoice-paper-bottom {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .invoice-paper-title {
        text-align: left;
    }

    .invoice-paper-bottom {
        display: grid;
    }

    .invoice-totals {
        justify-items: stretch;
    }

    .invoice-paper-footer {
        flex-direction: column;
    }

    .invoice-lines {
        min-width: 720px;
    }

    .packlist-paper .invoice-paper-parties {
        grid-template-columns: 1fr;
    }

    .packlist-paper .invoice-paper-footer {
        flex-direction: column;
    }
}

@media print {
    .invoice-preview-actions {
        display: none;
    }

    .invoice-paper {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 17mm 16mm 14mm;
        box-shadow: none;
    }

    .packlist-paper {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 17mm 16mm 14mm;
        box-shadow: none;
    }
}

body.print-page {
    min-height: 100vh;
    background: #fff;
}

.print-main {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.print-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.print-header {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) minmax(180px, 260px);
    align-items: center;
    gap: 22px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--brand);
}

.print-header img {
    display: block;
    width: 140px;
    max-height: 110px;
    object-fit: contain;
}

.print-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.print-header p {
    margin: 0;
}

.print-barcode {
    display: grid;
    gap: 5px;
    justify-items: center;
    text-align: center;
}

.print-barcode svg {
    width: 100%;
    height: 60px;
}

.print-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 18px;
    color: var(--muted);
}

.price-list {
    width: 100%;
    border-collapse: collapse;
}

.price-list th,
.price-list td {
    padding: 8px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.price-list th {
    background: #f2f3f3;
    color: #454545;
    font-size: 12px;
    text-transform: uppercase;
}

.price-list .text-right,
.price-list td.text-right {
    text-align: right;
}

.avery-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 12mm 8mm;
    display: grid;
    grid-template-columns: repeat(4, 48.5mm);
    grid-auto-rows: 25.4mm;
    align-content: start;
    column-gap: 0;
    row-gap: 0;
    background: #fff;
}

.avery-label {
    width: 48.5mm;
    height: 25.4mm;
    overflow: hidden;
    display: grid;
    align-content: center;
    gap: 1px;
    padding: 1.4mm;
    border: 1px dotted #c9c9c9;
    color: #111;
    font-size: 8px;
    line-height: 1.15;
}

.avery-label strong,
.avery-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avery-label svg {
    width: 100%;
    height: 8mm;
}

.avery-label-empty {
    border-color: transparent;
    background: transparent;
}

.label-preview-heading {
    width: min(100%, 210mm);
    margin: 18px auto 8px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
}

.label-preview-heading h2 {
    margin: 0;
    font-size: 18px;
}

.label-preview-heading span {
    color: var(--muted);
    font-size: 13px;
}

.site-overview-table {
    min-width: 1180px;
}

.site-overview-table td {
    vertical-align: top;
}

.site-overview-table code {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .job-meta-grid,
    .procurement-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .print-barcode {
        grid-column: 1 / -1;
        justify-items: start;
        text-align: left;
    }
}

@media (max-width: 620px) {
    .scanner-form,
    .print-toolbar,
    .invoice-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .scanner-form .btn {
        width: 100%;
    }

    .job-meta-grid,
    .procurement-form {
        grid-template-columns: 1fr;
    }

    .procurement-form .wide {
        grid-column: auto;
    }

    .print-main {
        padding: 14px;
    }

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

    .print-header img {
        width: 120px;
    }

    .price-list {
        display: block;
        overflow-x: auto;
    }
}

@media print {
    body.print-page {
        background: #fff;
    }

    .print-main {
        width: 100%;
        padding: 0;
    }

    .print-toolbar {
        display: none;
    }

    .avery-sheet {
        margin: 0;
        padding: 12mm 8mm;
    }

    .avery-label {
        border-color: transparent;
    }
}

/* Klare Hauptnavigation mit eingeruecktem Werkstatt-Untermenue */
.nav-section {
    display: grid;
    gap: 4px;
}

.nav-section-collapsible {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.nav-section-label {
    padding: 8px 10px 3px;
    color: #858585;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.nav-section-workshop {
    gap: 5px;
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.nav-workshop-group {
    display: grid;
    gap: 3px;
}

.nav-parent {
    min-height: 42px;
}

.nav button.nav-link {
    width: 100%;
    border: 0;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.nav button.nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 7px;
    background: transparent;
    color: var(--ink);
    font-weight: 650;
}

.nav button.nav-section-toggle:hover,
.nav button.nav-section-toggle.active {
    background: #f8e9ea;
    color: var(--brand-strong);
}

.nav-submenu[hidden] {
    display: none;
}

.nav-chevron {
    color: currentColor;
    font-size: 18px;
    line-height: 1;
    transform: rotate(90deg);
}

.nav-parent[aria-expanded="true"] .nav-chevron {
    transform: rotate(-90deg);
}

.nav-submenu {
    display: grid;
    gap: 2px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 2px solid var(--line);
}

.nav-sub-link {
    display: block;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.nav-sub-link:hover,
.nav-sub-link.active {
    background: #f8e9ea;
    color: var(--brand-strong);
}

.collapsible-panel > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.collapsible-panel > summary::-webkit-details-marker {
    display: none;
}

.collapse-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.collapse-indicator::before {
    content: '+';
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
}

.collapsible-panel[open] .collapse-indicator::before {
    content: '-';
}

body.workshop-area .nav-section-label {
    color: #9eabc5;
}

body.workshop-area .nav-section-workshop {
    border-top-color: rgba(210, 225, 255, .18);
}

body.workshop-area .nav-section-collapsible {
    border-top-color: rgba(210, 225, 255, .18);
}

body.workshop-area .nav button.nav-link {
    color: #d6deef;
}

body.workshop-area .nav button.nav-link:hover {
    background: rgba(86, 130, 215, .18);
    color: #fff;
}

body.workshop-area .nav button.nav-link.active {
    background: #3266c1;
    color: #fff;
}

body.workshop-area .nav button.nav-section-toggle {
    color: #d6deef;
}

body.workshop-area .nav button.nav-section-toggle:hover,
body.workshop-area .nav button.nav-section-toggle.active {
    background: rgba(86, 130, 215, .18);
    color: #fff;
}

body.workshop-area .nav button.nav-section-toggle.active {
    background: #3266c1;
}

body.workshop-area .nav-submenu {
    border-left-color: rgba(157, 185, 242, .45);
}

body.workshop-area .nav-sub-link {
    color: #b7c4dc;
}

body.workshop-area .nav-sub-link:hover,
body.workshop-area .nav-sub-link.active {
    background: rgba(86, 130, 215, .18);
    color: #fff;
}

.permission-intro .panel-body {
    display: grid;
    gap: 10px;
}

.permission-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    color: var(--muted);
    font-size: 13px;
}

.permission-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.permission-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    background: #c9c5ba;
}

.permission-dot.individual {
    background: var(--brand);
}

.permission-dot.admin {
    background: var(--ok);
}

.permission-table-wrap {
    overflow-x: auto;
}

.permissions-table {
    min-width: 2050px;
}

.permissions-table th,
.permissions-table td {
    min-width: 88px;
    padding: 9px 7px;
    text-align: center;
    vertical-align: middle;
}

.permissions-table th {
    min-width: 106px;
    white-space: normal;
    text-transform: none;
    line-height: 1.25;
}

.permissions-table th > span {
    display: block;
}

.permissions-table .permission-category {
    margin-bottom: 4px;
    color: var(--brand-strong);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.permission-user-col {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 220px !important;
    width: 220px;
    text-align: left !important;
    background: var(--panel) !important;
}

.permissions-table thead .permission-user-col {
    z-index: 3;
    background: #f2f0ea !important;
}

.permission-user-col strong,
.permission-user-col .muted,
.permission-user-col .permission-role {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permission-user-col .muted,
.permission-role {
    color: var(--muted);
    font-size: 11px;
}

.permission-cell {
    background: #fff;
}

.permission-cell.permission-overridden {
    background: #fff5f5;
}

.permission-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    margin: 0;
    cursor: pointer;
}

.permission-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.permission-checkmark {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border: 2px solid #b8b5ad;
    border-radius: 5px;
    background: #fff;
}

.permission-toggle input:checked + .permission-checkmark {
    border-color: var(--brand);
    background: var(--brand);
}

.permission-toggle input:checked + .permission-checkmark::after {
    width: 9px;
    height: 5px;
    content: '';
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}

.permission-toggle input:focus-visible + .permission-checkmark {
    outline: 2px solid rgba(180, 30, 40, .25);
    outline-offset: 2px;
}

.permission-toggle input:disabled + .permission-checkmark {
    border-color: var(--ok);
    background: var(--ok);
    opacity: .85;
}

.permission-actions-col {
    position: sticky;
    right: 0;
    z-index: 2;
    min-width: 150px !important;
    background: var(--panel) !important;
    text-align: center !important;
}

.permissions-table thead .permission-actions-col {
    z-index: 3;
    background: #f2f0ea !important;
}

.permission-actions-col .btn {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
}

.permission-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
    .nav {
        display: grid;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        padding-bottom: 0;
    }

    .nav-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .nav-section-label {
        grid-column: 1 / -1;
        padding-top: 5px;
    }

    .nav-section-workshop,
    .nav-workshop-group {
        grid-template-columns: 1fr;
    }

    .nav-section-workshop .nav-section-label,
    .nav-section-workshop .nav-workshop-group,
    .nav-submenu {
        grid-column: 1 / -1;
    }

    .nav-submenu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-left: 0;
        padding-left: 8px;
    }

    .nav-sub-link {
        min-height: 36px;
        padding: 8px 7px;
        font-size: 12px;
    }
}

@media (max-width: 980px) {
    .assignment-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .assignment-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Globale Darstellung aus System > Einstellungen. */
body {
    font-family: var(--app-font-family, Lato, "Segoe UI", Arial, sans-serif);
    font-size: var(--app-font-size, 15px);
}

body.theme-dark {
    --bg: #12161b;
    --panel: #1d232a;
    --panel-soft: #262d35;
    --ink: #edf2f6;
    --muted: #aeb8c3;
    --line: #3d4752;
    --danger: #e27b78;
    --ok: #75c99c;
    --warn: #e2b85f;
    --shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

body.theme-dark .sidebar {
    background: #171c22;
    color: var(--ink);
    border-right-color: var(--line);
}

body.theme-dark .brand,
body.theme-dark .user-box {
    border-color: var(--line);
}

body.theme-dark .nav a,
body.theme-dark .nav button.nav-link,
body.theme-dark .nav-section-label {
    color: #dbe4ec;
}

body.theme-dark .nav a:hover,
body.theme-dark .nav button.nav-link:hover,
body.theme-dark .nav button.nav-section-toggle:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

body.theme-dark .nav a.active,
body.theme-dark .nav button.nav-link.active,
body.theme-dark .nav button.nav-section-toggle.active {
    background: var(--brand);
    color: #fff;
}

body.theme-dark .panel,
body.theme-dark .login-branding,
body.theme-dark .lift-tile {
    background: var(--panel);
    border-color: var(--line);
}

body.theme-dark .panel-head,
body.theme-dark th {
    background: var(--panel-soft);
    color: var(--ink);
    border-color: var(--line);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    border-color: #53606d;
    background: #151a20;
    color: var(--ink);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: #8995a1;
}

body.theme-dark .btn.secondary {
    border-color: #617080;
    background: #252d36;
    color: var(--ink);
}

body.theme-dark .btn.secondary:hover {
    background: #303b47;
}

body.theme-dark .help-flow span,
body.theme-dark .permission-cell,
body.theme-dark .permission-actions-col {
    background: var(--panel-soft) !important;
}

body.theme-dark .permission-cell.permission-overridden {
    background: #3a292d !important;
}

body.theme-dark .permission-user-col,
body.theme-dark .permissions-table thead .permission-user-col {
    background: var(--panel) !important;
}

body.theme-dark .permissions-table thead .permission-user-col,
body.theme-dark .permissions-table thead .permission-actions-col {
    background: var(--panel-soft) !important;
}

body.theme-dark .permission-checkmark {
    border-color: #71808d;
    background: #151a20;
}

body.theme-dark .login-screen {
    background: var(--bg);
}

body.theme-dark .login-branding {
    background: var(--panel);
}

body.theme-dark .changelog-preview,
body.theme-dark .flash,
body.theme-dark .scanner-pill,
body.theme-dark .user-pill {
    background: var(--panel);
    border-color: var(--line);
    color: var(--ink);
}

body.theme-dark .badge {
    background: #303943;
    color: var(--ink);
}

.help-topic-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin: 0;
}

.help-topic {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
}

.help-topic summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    color: var(--ink);
    font-weight: 750;
}

.help-topic summary > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.help-topic summary em {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-style: normal;
}

.help-topic summary::-webkit-details-marker {
    display: none;
}

.help-topic summary::after {
    content: '+';
    color: var(--brand);
    font-size: 20px;
    line-height: 1;
}

.help-topic[open] summary::after {
    content: '-';
}

.help-topic-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.help-topic-body ol,
.help-topic-body ul {
    margin: 12px 0 0;
    padding-left: 20px;
}

.help-topic-body li + li {
    margin-top: 7px;
}

@media (max-width: 760px) {
    .help-quick-grid,
    .help-role-grid {
        grid-template-columns: 1fr;
    }

    .help-topic-list {
        grid-template-columns: 1fr;
    }

    .permission-save-bar {
        align-items: stretch;
        flex-direction: column;
    }
}
