* {
    box-sizing: border-box;
}

:root {
    font-family: Arial, Helvetica, sans-serif;
    color-scheme: light;

    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1c2430;
    --muted: #687180;
    --border: #d8dde5;

    --primary: #1f5f99;
    --primary-dark: #174a77;

    --danger-bg: #fdecec;
    --danger-text: #8a1f1f;

    --success-bg: #eaf7ee;
    --success-text: #24633a;

    --info-bg: #edf4fb;
    --info-text: #24557a;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 460px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.brand {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--primary);
    margin-bottom: 10px;
}

h1 {
    margin-top: 0;
}

h2 {
    margin: 0;
    font-size: 20px;
}

label {
    display: block;
    font-weight: 700;
    margin: 0 0 7px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
    font: inherit;
    background: #ffffff;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(31, 95, 153, 0.15);
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 10px 18px;
    border: 0;
    border-radius: 9px;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e9edf2;
    color: var(--text);
}

.btn-secondary:hover {
    background: #dfe4ea;
}

.btn-danger-soft {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.btn-success-soft {
    background: var(--success-bg);
    color: var(--success-text);
}

.btn-small {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    margin-top: 24px;
}

.muted,
.security-note {
    color: var(--muted);
}

.security-note {
    font-size: 13px;
    margin-top: 18px;
}

.setup-summary {
    border: 1px solid var(--border);
    background: #f9fafb;
    border-radius: 10px;
    padding: 15px;
    line-height: 1.7;
}

.alert {
    padding: 13px 14px;
    border-radius: 9px;
    margin: 16px 0;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
}

.topbar {
    min-height: 66px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.topbar a {
    color: var(--primary);
}

.role {
    padding: 4px 7px;
    background: #edf4fb;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
}

.welcome {
    margin-bottom: 24px;
}

.welcome-with-logo {
    position: relative;
    min-height: 60px;
    padding-right: 250px;
}

.welcome-text {
    min-width: 0;
}

.welcome-logo {
    position: absolute;
    top: -4px;
    right: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.customer-logo {
    display: block;
    width: 220px;
    height: 40px;
    object-fit: contain;
    object-position: right center;
}

.page-header {
    margin-bottom: 24px;
}

.page-header-with-logo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

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

.dashboard-card {
    min-height: 170px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
}

.dashboard-card strong {
    font-size: 22px;
}

.dashboard-card small {
    color: var(--muted);
    font-size: 14px;
}

.dashboard-icon {
    font-size: 32px;
    line-height: 1;
    color: var(--primary);
}

.dashboard-card-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.dashboard-card-link:hover {
    transform: translateY(-1px);
    border-color: #b9c6d3;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dashboard-card-disabled {
    opacity: 0.62;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 22px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.panel-header p {
    margin: 6px 0 0;
}

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

.form-field {
    min-width: 0;
}

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

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

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

.badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 7px;
    background: #edf4fb;
    color: var(--info-text);
    font-size: 12px;
    font-weight: 700;
}

.status {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
}

.status-active {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-inactive {
    background: #eef0f3;
    color: #5d6672;
}

.actions-cell {
    white-space: nowrap;
}

.inline-form {
    display: inline;
    margin-left: 6px;
}

@media (max-width: 700px) {

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

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-user {
        flex-wrap: wrap;
    }

    .welcome-with-logo {
        min-height: 60px;
        padding-right: 210px;
        padding-top: 0;
    }

    .welcome-logo {
        top: -4px;
        right: 0;
    }

    .customer-logo {
        width: 200px;
        height: 40px;
        object-fit: contain;
        object-position: right center;
    }

    .page-header-with-logo {
        gap: 16px;
    }

    .page-header-with-logo .customer-logo {
        width: 160px;
    }

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

    .form-span-2 {
        grid-column: span 1;
    }

    .panel {
        padding: 18px;
    }
}

/* Ergänzungen für Mitarbeiterverwaltung */

.stats-row {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.mini-stat {
    min-width: 130px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-stat strong {
    font-size: 26px;
    line-height: 1;
}

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

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

.panel-header-search {
    align-items: center;
}

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

.search-form input {
    width: min(360px, 70vw);
    min-height: 38px;
}

.text-warning {
    color: #8a5a00;
    font-weight: 700;
}

.empty-table {
    text-align: center !important;
    color: var(--muted);
    padding: 28px !important;
}

@media (max-width: 700px) {
    .panel-header-search {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form {
        width: 100%;
    }

    .search-form input {
        width: 100%;
    }
}

/* =========================================================
   SENDUNGSERFASSUNG
   ========================================================= */

.shipment-form {
    padding: 0;
    overflow: hidden;
}

.form-section {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.form-section-title h2 {
    margin-bottom: 4px;
}

.form-section-title p {
    margin: 0;
}

.step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 700;
}

.recipient-type {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.radio-card {
    margin: 0;
    cursor: pointer;
}

.radio-card input {
    width: auto;
    min-height: auto;
    margin-right: 7px;
}

.radio-card span {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #ffffff;
}

.radio-card:has(input:checked) span {
    border-color: var(--primary);
    background: #edf4fb;
    color: var(--primary-dark);
    font-weight: 700;
}

textarea {
    resize: vertical;
}

.form-section-summary {
    background: #fafbfc;
}

.summary-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.summary-box > div {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    color: var(--muted);
    font-size: 12px;
}

.btn-large {
    min-height: 56px;
    padding-left: 24px;
    padding-right: 24px;
    font-size: 16px;
}

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

.detail-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.detail-item span,
.detail-note > span {
    color: var(--muted);
    font-size: 12px;
}

.detail-item strong {
    overflow-wrap: anywhere;
}

.detail-note {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.detail-note p {
    margin: 6px 0 0;
}

/* =========================================================
   ETIKETTEN – 100 x 150 mm
   ========================================================= */

.labels-page {
    background: #e9ebef;
}

.labels-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 20px;
}

.labels-toolbar-actions {
    display: flex;
    gap: 8px;
}

.labels-container {
    width: min(900px, calc(100% - 30px));
    margin: 24px auto;
    display: grid;
    gap: 20px;
    justify-content: center;
}

.package-label {
    width: 100mm;
    height: 150mm;
    background: #ffffff;
    border: 1px solid #bfc4ca;
    padding: 7mm;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.label-brand {
    font-size: 13pt;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 6mm;
}

.label-recipient {
    margin-bottom: 6mm;
}

.label-recipient span {
    display: block;
    font-size: 9pt;
    color: #555555;
    text-transform: uppercase;
}

.label-recipient strong {
    display: block;
    font-size: 22pt;
    line-height: 1.1;
    margin-top: 2mm;
}

.label-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
    margin-bottom: 6mm;
}

.label-meta span {
    display: block;
    font-size: 8pt;
    color: #555555;
    text-transform: uppercase;
}

.label-meta strong {
    display: block;
    font-size: 12pt;
    margin-top: 1mm;
}

.label-package-count {
    margin-bottom: 5mm;
    font-size: 20pt;
    font-weight: 700;
    text-align: center;
    padding: 3mm;
    border: 2px solid #000000;
}

.qr-code {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2mm auto 3mm;
}

.qr-code img,
.qr-code canvas {
    width: 50mm !important;
    height: 50mm !important;
}

.label-code {
    font-size: 14pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    margin-bottom: 4mm;
}

.label-footer {
    margin-top: auto;
    border-top: 1px solid #999999;
    padding-top: 4mm;
    display: flex;
    justify-content: space-between;
    gap: 6mm;
    font-size: 9pt;
}

@media (max-width: 900px) {

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

@media (max-width: 700px) {

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

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

    .form-section {
        padding: 18px;
    }

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

    .package-label {
        width: min(100%, 100mm);
        height: auto;
        min-height: 150mm;
    }
}

@media print {

    @page {
        size: 100mm 150mm;
        margin: 0;
    }

    body.labels-page {
        background: #ffffff;
    }

    .labels-toolbar {
        display: none !important;
    }

    .labels-container {
        display: block;
        width: auto;
        margin: 0;
    }

    .package-label {
        width: 100mm;
        height: 150mm;
        min-height: 150mm;
        border: 0;
        page-break-after: always;
        break-after: page;
        overflow: hidden;
    }

    .package-label:last-child {
        page-break-after: auto;
        break-after: auto;
    }
}

/* =========================================================
   ÜBERSICHT / AUSGABE
   ========================================================= */

.overview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.overview-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.overview-tab {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.overview-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

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

.overview-search input {
    width: min(430px, 72vw);
    min-height: 38px;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: #f7f9fb;
}

.table-subtext {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.status-partial {
    background: #fff4d6;
    color: #775a00;
}

.status-done {
    background: #eef0f3;
    color: #555f6b;
}

.scan-panel {
    overflow: hidden;
}

.scan-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.manual-scan-form {
    display: flex;
    flex: 1 1 520px;
    align-items: center;
    gap: 8px;
}

.manual-scan-form input {
    flex: 1;
}

.qr-reader {
    max-width: 520px;
    margin: 20px auto 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
}

.basket-list {
    display: grid;
    gap: 10px;
}

.basket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
}

.basket-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.basket-item-main strong {
    font-size: 16px;
    color: var(--primary-dark);
}

.basket-item-main span {
    font-weight: 700;
}

.basket-item-main small {
    color: var(--muted);
}

.empty-basket {
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    text-align: center;
}

button:disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.success-card {
    max-width: 650px;
    margin: 40px auto 24px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    text-align: center;
}

.success-check {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 38px;
    font-weight: 700;
}

.success-card h2 {
    margin-bottom: 10px;
}

.success-actions {
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    .overview-toolbar,
    .overview-search,
    .manual-scan-form {
        width: 100%;
    }

    .overview-search input {
        width: 100%;
    }

    .manual-scan-form {
        flex-direction: column;
        align-items: stretch;
    }

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

    .basket-item .btn {
        width: 100%;
    }
}

/* =========================================================
   E-MAIL-EINSTELLUNGEN
   ========================================================= */

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.checkbox-line input {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0;
}

.mail-test-box {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.mail-test-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mail-test-row input {
    flex: 1;
}

@media (max-width: 700px) {
    .mail-test-row {
        align-items: stretch;
        flex-direction: column;
    }
}

/* =========================================================
   FOTOS BEI PAKETANNAHME
   ========================================================= */

.photo-upload-grid input[type="file"] {
    padding: 9px 10px;
    background: #ffffff;
}

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

.shipment-photo-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
}

.shipment-photo-card img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: #eef0f3;
}

.shipment-photo-card span {
    display: block;
    padding: 10px 12px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .shipment-photo-gallery {
        grid-template-columns: 1fr;
    }

    .shipment-photo-card img {
        height: auto;
        max-height: 420px;
        object-fit: contain;
    }
}

/* =========================================================
   FOOTER / IMPRESSUM / DATENSCHUTZ
   ========================================================= */

.auth-page {
    display: block;
}

.auth-page-layout {
    min-height: calc(100vh - 48px);
    display: grid;
    grid-template-rows: 1fr auto;
}

.auth-page-layout .auth-card {
    align-self: center;
    justify-self: center;
}

.public-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

.public-footer a {
    color: var(--primary);
    text-decoration: none;
}

.public-footer a:hover {
    text-decoration: underline;
}

.auth-footer {
    margin-top: 20px;
    margin-bottom: 0;
}

.footer-separator {
    color: #a1a8b2;
}

.public-topbar {
    min-height: 66px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.public-brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.public-nav a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.legal-container {
    width: min(900px, calc(100% - 32px));
    margin: 32px auto;
}

.legal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 30px;
}

.legal-card h1 {
    margin-bottom: 8px;
}

.legal-card h2 {
    margin-top: 30px;
    margin-bottom: 9px;
}

.legal-card p,
.legal-card li {
    line-height: 1.65;
}

.legal-card ul {
    padding-left: 22px;
}

.legal-intro {
    color: var(--muted);
    font-size: 16px;
    margin-top: 0;
}

.legal-address {
    font-style: normal;
    line-height: 1.7;
}

.legal-card a {
    color: var(--primary);
}

.legal-note {
    margin-top: 30px;
    padding: 14px 16px;
    border: 1px solid #efcf84;
    border-radius: 9px;
    background: #fff8e7;
    color: #654b0c;
    line-height: 1.5;
    font-size: 13px;
}

@media (max-width: 700px) {

    .public-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .legal-card {
        padding: 20px;
    }

    .public-footer {
        margin-top: 24px;
    }
}

/* =========================================================
   VERTEILERLISTEN
   ========================================================= */

.page-inline-actions {
    margin-top: 12px;
}

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

.member-option {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 62px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
}

.member-option:hover {
    border-color: #b9c6d3;
}

.member-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.member-option span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.member-option strong {
    font-size: 14px;
}

.member-option small {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.member-option-inactive {
    opacity: 0.55;
}

@media (max-width: 700px) {
    .member-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   ANNAHME VERWEIGERT
   ========================================================= */

.status-rejected {
    background: #fdecec;
    color: #9b1c1c;
}

.rejected-shipment-panel {
    border-left: 4px solid #b42318;
}

#storage-section[style*="display: none"] {
    margin: 0;
    padding: 0;
    border: 0;
}

/* Produktion direkt unter dem Empfängernamen auf dem Paketlabel */

.label-production {
    margin-top: 2mm;
    font-size: 13pt;
    line-height: 1.15;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* =========================================================
   PROBLEMMARKIERUNG / MONATSREPORT / FOTOS ERGÄNZEN
   ========================================================= */

.status-problem {
    background: #fde8e8;
    color: #9b1c1c;
}

.problem-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 16px 18px;
    margin: 16px 0 22px;
    border: 1px solid #efb4b4;
    border-radius: 12px;
    background: #fff5f5;
}

.problem-banner p {
    margin: 6px 0 0;
    white-space: normal;
}

.problem-panel-active {
    border-color: #efb4b4;
}

.problem-note {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
    margin-bottom: 18px;
}

.mini-stat-problem {
    border-color: #efb4b4;
}

.photo-add-later {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.photo-add-later h3 {
    margin: 0 0 14px;
}

.report-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.report-toolbar .form-field {
    min-width: 220px;
}

.report-toolbar-actions {
    margin-top: 0;
}

.report-stats {
    margin-bottom: 22px;
}

.report-table {
    min-width: 1400px;
}

@media (max-width: 700px) {

    .problem-banner {
        flex-direction: column;
    }

    .report-toolbar {
        align-items: stretch;
    }

    .report-toolbar .form-field {
        width: 100%;
    }
}

/* Übersicht kompakter: weniger horizontale Breite */

.overview-table {
    min-width: 0;
    font-size: 13px;
}

.overview-table th,
.overview-table td {
    padding: 10px 8px;
}

.overview-table th {
    letter-spacing: 0.025em;
}

.overview-table .overview-packages-cell,
.overview-table .overview-open-cell {
    white-space: nowrap;
    text-align: center;
}

.overview-table th:nth-child(8),
.overview-table th:nth-child(9) {
    text-align: center;
}

.overview-table td:nth-child(5),
.overview-table th:nth-child(5),
.overview-table td:nth-child(7),
.overview-table th:nth-child(7) {
    white-space: nowrap;
}


/* =========================================================
   VIDEO-PLAYER DESIGN ALIGNMENT
   Rein visuelle Anpassung – keine Funktionslogik betroffen.
   Grundlage: Video-Player Light v0.5.x
   ========================================================= */

:root {
    --vp-bg: #f4f5f7;
    --vp-surface: #ffffff;
    --vp-text: #1c2430;
    --vp-muted: #687180;
    --vp-border: #d8dde5;
    --vp-primary: #1f5f99;
    --vp-primary-dark: #174a77;
    --vp-soft-blue: #edf4fb;
    --vp-soft-panel: #f8fafb;

    --vp-radius: 14px;
    --vp-radius-small: 8px;

    --vp-shadow: 0 8px 24px rgba(28, 36, 48, 0.055);
    --vp-shadow-hover: 0 12px 28px rgba(28, 36, 48, 0.085);
}


/* =========================================================
   GRUNDLAYOUT
   ========================================================= */

body:not(.labels-page) {
    background: var(--vp-bg);
    color: var(--vp-text);
    line-height: 1.5;
}

.container {
    width: min(1500px, calc(100% - 48px));
    margin: 28px auto 44px;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    min-height: 66px;

    padding:
        10px
        max(
            24px,
            calc((100vw - 1500px) / 2 + 24px)
        );

    background: var(--vp-surface);
    border-bottom: 1px solid var(--vp-border);
    box-shadow: none;
}

.topbar > div:first-child strong {
    font-size: 14px;
    letter-spacing: 0.12em;
    color: var(--vp-primary);
}

.topbar-user {
    gap: 10px;
}

.topbar-user > a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 12px;
    border-radius: var(--vp-radius-small);
    text-decoration: none;
    font-weight: 700;
    color: var(--vp-primary);
}

.topbar-user > a:hover {
    background: var(--vp-soft-blue);
    color: var(--vp-primary-dark);
}

.role {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--vp-soft-blue);
    color: #24557a;
}


/* =========================================================
   SEITENKOPF / ÜBERSCHRIFTEN
   ========================================================= */

.page-header,
.welcome {
    margin-bottom: 22px;
}

.page-header h1,
.welcome h1 {
    margin-bottom: 5px;
    font-size: clamp(26px, 2.4vw, 32px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.page-header p,
.welcome p {
    margin-top: 0;
}

.customer-logo {
    max-width: 220px;
}


/* =========================================================
   PANELS / KARTEN
   ========================================================= */

.panel,
.dashboard-card,
.mini-stat,
.success-card {
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    background: var(--vp-surface);
    box-shadow: none;
}

.panel {
    padding: 24px;
    margin-bottom: 24px;
}

.panel:hover {
    border-color: #cbd4dc;
}

.panel-header {
    margin-bottom: 18px;
}

.panel-header h2 {
    font-size: 22px;
    line-height: 1.2;
}


/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-grid {
    gap: 20px;
}

.dashboard-card {
    min-height: 155px;
    padding: 22px;
    justify-content: flex-start;
    gap: 8px;
}

.dashboard-card strong {
    font-size: 20px;
    line-height: 1.25;
}

.dashboard-icon {
    margin-bottom: 4px;
    color: var(--vp-primary);
}

.dashboard-card-link {
    transition:
        transform 0.14s ease,
        box-shadow 0.14s ease,
        border-color 0.14s ease,
        background 0.14s ease;
}

.dashboard-card-link:hover {
    transform: translateY(-2px);
    border-color: #bdcbd5;
    box-shadow: var(--vp-shadow-hover);
    background: #ffffff;
}

.mini-stat {
    border-radius: 12px;
}


/* =========================================================
   FORMULARE
   ========================================================= */

label {
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    min-height: 44px;
    border: 1px solid #abbcc1;
    border-radius: 9px;
    padding: 10px 12px;

    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease;
}

textarea {
    min-height: 96px;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #93a8ae;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--vp-primary);
    box-shadow: 0 0 0 3px rgba(31, 95, 153, 0.14);
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    min-height: 44px;
    padding: 9px 16px;
    border-radius: 7px;
    font-weight: 700;

    transition:
        background 0.12s ease,
        color 0.12s ease,
        border-color 0.12s ease,
        transform 0.08s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--vp-primary);
}

.btn-primary:hover {
    background: var(--vp-primary-dark);
}

.btn-secondary {
    background: #edf3f4;
    color: #254e5a;
}

.btn-secondary:hover {
    background: #e2ecee;
    color: #1c414b;
}

.btn-small {
    min-height: 34px;
    padding: 6px 10px;
}


/* =========================================================
   ÜBERSICHT / TABS
   ========================================================= */

.overview-tabs {
    gap: 8px;
}

.overview-tab {
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--vp-primary);
}

.overview-tab:hover {
    background: var(--vp-soft-blue);
}

.overview-tab.active {
    background: var(--vp-primary);
    color: #ffffff;
}


/* =========================================================
   TABELLEN
   ========================================================= */

.table-wrap {
    border: 1px solid var(--vp-border);
    border-radius: 12px;
    background: #ffffff;
}

.data-table {
    min-width: 850px;
}

.data-table th {
    padding-top: 11px;
    padding-bottom: 11px;
    background: var(--vp-soft-panel);
    color: #556b78;
    font-size: 11px;
    letter-spacing: 0.06em;
}

.data-table th:first-child {
    border-top-left-radius: 11px;
}

.data-table th:last-child {
    border-top-right-radius: 11px;
}

.data-table td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.data-table tbody tr:hover td {
    background: #f8fafb;
}


/* =========================================================
   DETAILKARTEN / ZUSAMMENFASSUNGEN
   ========================================================= */

.detail-item,
.summary-box > div,
.basket-item,
.qr-reader {
    border-radius: 10px;
    border-color: var(--vp-border);
    background: #ffffff;
}

.detail-item {
    background: #fbfcfd;
}

.form-section-summary {
    background: #f8fafb;
}


/* =========================================================
   BADGES / STATUS
   ========================================================= */

.badge,
.status {
    border-radius: 999px;
    padding: 5px 9px;
}

.badge {
    background: var(--vp-soft-blue);
    color: #24557a;
}


/* =========================================================
   MELDUNGEN
   ========================================================= */

.alert {
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-success {
    border-color: #cce6d5;
}

.alert-error {
    border-color: #f1cdcd;
}

.alert-info {
    border-color: #d4e3f0;
}


/* =========================================================
   LOGIN
   ========================================================= */

.auth-page {
    background: var(--vp-bg);
}

.auth-card {
    width: min(100%, 440px);
    border: 1px solid var(--vp-border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    font-size: 30px;
    line-height: 1.15;
    margin-bottom: 10px;
}

.auth-card .brand {
    color: var(--vp-primary);
    font-size: 12px;
    letter-spacing: 0.15em;
}


/* =========================================================
   FOCUS
   ========================================================= */

.btn:focus-visible,
.topbar a:focus-visible,
.overview-tab:focus-visible,
.dashboard-card-link:focus-visible {
    outline: 2px solid var(--vp-primary);
    outline-offset: 2px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .container {
        width: min(calc(100% - 32px), 1500px);
    }
}

@media (max-width: 700px) {

    .container {
        width: calc(100% - 24px);
        margin-top: 20px;
    }

    .topbar {
        padding: 12px 16px;
        gap: 10px;
    }

    .topbar-user {
        width: 100%;
    }

    .topbar-user > a {
        padding-left: 9px;
        padding-right: 9px;
    }

    .panel {
        padding: 18px;
    }

    .page-header h1,
    .welcome h1,
    .auth-card h1 {
        font-size: 24px;
    }

    .dashboard-card {
        min-height: 135px;
    }
}

/* =========================================================
   APP SHELL – WIE VIDEO-PLAYER
   ========================================================= */

.app-shell-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.app-shell-header-inner {
    width: 100%;
    min-height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.app-shell-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.app-shell-logo {
    display: block;
    width: 220px;
    height: 52px;
    object-fit: contain;
    object-position: left center;
}

.app-shell-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 7px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.app-shell-product:hover {
    background: var(--primary-dark);
}

.app-shell-main {
    width: min(1080px, calc(100% - 32px));
    margin: 34px auto 48px;
}

.app-shell-eyebrow {
    margin-bottom: 14px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.app-shell-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 22px;
}

.app-shell-title-row h1 {
    margin: 0;
    font-size: 31px;
    line-height: 1.15;
}

.app-shell-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 15px;
    border-radius: 7px;
    background: var(--info-bg);
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.app-shell-logout:hover {
    background: #e1edf7;
}

.app-shell-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.app-shell-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 15px;
    border-radius: 7px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.app-shell-nav-item:hover {
    background: var(--info-bg);
    color: var(--primary-dark);
}

.app-shell-nav-item-active {
    background: var(--primary);
    color: #ffffff;
}

.app-shell-nav-item-active:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.app-dashboard-panel {
    padding: 22px;
}

.app-dashboard-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.app-dashboard-intro h2 {
    margin: 0 0 5px;
    font-size: 20px;
}

.app-dashboard-intro p {
    margin: 0;
}

.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-quick-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        transform 0.12s ease;
}

.dashboard-quick-card:hover {
    border-color: #b9c8d5;
    box-shadow: 0 8px 20px rgba(28, 36, 48, 0.06);
    transform: translateY(-1px);
}

.dashboard-quick-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--info-bg);
    color: var(--primary);
    font-size: 23px;
    font-weight: 700;
}

.dashboard-quick-card > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dashboard-quick-card strong {
    font-size: 15px;
}

.dashboard-quick-card span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.app-shell-main .public-footer {
    width: 100%;
    margin: 28px 0 0;
}

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

@media (max-width: 700px) {
    .app-shell-header-inner {
        min-height: auto;
        padding: 12px;
    }

    .app-shell-logo {
        width: 175px;
        height: 46px;
    }

    .app-shell-brand {
        gap: 12px;
    }

    .app-shell-product {
        min-height: 36px;
        padding: 7px 14px;
        font-size: 13px;
    }

    .app-shell-main {
        width: calc(100% - 24px);
        margin-top: 22px;
    }

    .app-shell-title-row {
        align-items: flex-start;
        gap: 16px;
    }

    .app-shell-title-row h1 {
        font-size: 25px;
    }

    .app-shell-nav {
        width: 100%;
        padding-bottom: 4px;
    }

    .app-shell-nav-item {
        min-height: 38px;
        padding: 7px 11px;
        font-size: 13px;
    }

    .app-dashboard-panel {
        padding: 17px;
    }
}
