:root {
    color-scheme: light;
    --primary: #086fd8;
    --primary-dark: #0559ad;
    --success: #0aa679;
    --warning: #e78313;
    --danger: #e5484d;
    --purple: #7c3aed;
    --text: #10243a;
    --text-muted: #627386;
    --border: #dfe6ed;
    --surface: #ffffff;
    --surface-muted: #f5f7fa;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.attachment-section{margin-top:22px;padding-top:18px;border-top:1px solid var(--border)}
.attachment-heading{display:flex;align-items:center;justify-content:space-between}.attachment-heading h3{margin:0}.attachment-heading small,.selected-file{color:var(--text-muted)}.attachment-heading>span{display:grid;place-items:center;min-width:25px;height:25px;border-radius:50%;color:#166dcc;background:#eaf4ff;font-size:.7rem;font-weight:800}
.attachment-upload{display:flex;align-items:center;gap:8px;margin-top:12px}.attachment-upload input{max-width:230px}.selected-file{display:block;margin-top:6px}
.attachment-list{display:grid;gap:7px;margin-top:12px}.attachment-list article{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:9px;align-items:center;padding:9px;border:1px solid #e5ebf1;border-radius:8px}.attachment-list article>span{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;color:#176dcc;background:#eaf4ff}.attachment-list strong,.attachment-list small{display:block}.attachment-list small{color:var(--text-muted);font-size:.65rem}.attachment-list a,.attachment-list button{border:0;color:#176dcc;background:transparent;font-size:.7rem;font-weight:700;text-decoration:none}.attachment-list button{color:#c43b42;font-size:1rem}.attachment-empty{padding:12px;color:var(--text-muted);text-align:center}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: var(--surface-muted); }
body { margin: 0; overflow-x: hidden; color: var(--text); background: var(--surface-muted); font-size: 15px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
h1:focus { outline: none; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -.035em; }
.page-header p { margin: 7px 0 0; color: var(--text-muted); }
.eyebrow { margin-bottom: 7px; color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.primary-button, .secondary-button { border-radius: 8px; padding: 10px 15px; font-weight: 700; text-decoration: none; }
.primary-button { border: 1px solid var(--primary); color: white; background: var(--primary); }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { border: 1px solid var(--border); color: var(--text); background: white; }
.fleet-page-header { align-items: center; }
.fleet-page-header h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.2rem); line-height: 1.15; }
.fleet-page-header p { margin: 7px 0 0; }
.fleet-header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.2;
}

.card { border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: 0 1px 3px rgba(24, 44, 67, .04); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric { position: relative; min-height: 130px; padding: 20px; overflow: hidden; }
.metric::after { content: ""; position: absolute; width: 80px; height: 80px; right: -25px; bottom: -35px; border-radius: 50%; background: var(--metric-color, var(--primary)); opacity: .09; }
.metric-label { color: var(--text-muted); font-size: .78rem; font-weight: 700; }
.metric-value { margin-top: 9px; font-size: 2rem; font-weight: 800; letter-spacing: -.04em; }
.metric-note { margin-top: 8px; color: var(--text-muted); font-size: .75rem; }
.metric.green { --metric-color: var(--success); }
.metric.blue { --metric-color: var(--primary); }
.metric.purple { --metric-color: var(--purple); }
.metric.orange { --metric-color: var(--warning); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 18px; }
.section-card { padding: 22px; }
.section-card h2 { margin: 0; font-size: 1.05rem; }
.section-card > p { margin: 8px 0 20px; color: var(--text-muted); line-height: 1.55; }
.workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.workflow-step { min-height: 110px; padding: 15px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfd; }
.workflow-step strong { display: block; margin: 9px 0 5px; font-size: .84rem; }
.workflow-step small { color: var(--text-muted); line-height: 1.4; }
.step-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: white; background: var(--primary); font-size: .72rem; font-weight: 800; }
.task-list { display: grid; gap: 4px; margin-top: 16px; }
.task { display: flex; gap: 12px; padding: 13px 2px; border-bottom: 1px solid #edf1f4; }
.task:last-child { border-bottom: 0; }
.task-marker { width: 10px; height: 10px; flex: 0 0 auto; margin-top: 5px; border: 2px solid var(--primary); border-radius: 50%; }
.task-marker.done { border-color: var(--success); background: var(--success); }
.task strong { display: block; font-size: .84rem; }
.task small { color: var(--text-muted); }

.server-state { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 9px; background: #fff4f4; }
.server-state > span { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--danger); }
.server-state.online { background: #eaf8f4; }
.server-state.online > span { background: var(--success); }
.server-state strong, .server-state small { display: block; }
.server-state strong { font-size: .84rem; }
.server-state small { margin-top: 2px; color: var(--text-muted); font-size: .72rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; margin-bottom: 16px; }
.filter-control { min-width: 180px; flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); background: white; }
.table-card { overflow: hidden; }
.table-title { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.table-title h2 { margin: 0; font-size: 1rem; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 16px; color: var(--text-muted); background: #fafbfd; font-size: .7rem; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.data-table td { padding: 16px; border-top: 1px solid #edf1f4; }
.empty-state { padding: 52px 20px !important; color: var(--text-muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); }
.status-chip { display: inline-block; padding: 6px 10px; border-radius: 999px; color: #076b50; background: #e5f7f1; font-size: .74rem; font-weight: 750; }

.module-intro { min-height: 320px; display: grid; place-items: center; padding: 40px; text-align: center; }
.module-intro-inner { max-width: 580px; }
.module-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 17px; border-radius: 16px; color: var(--primary); background: #e9f3ff; font-size: 1.6rem; }
.module-intro h2 { margin: 0; }
.module-intro p { color: var(--text-muted); line-height: 1.6; }

.route-loading { min-height: 45vh; display: grid; place-items: center; color: var(--text-muted); }
.auth-page { min-height: calc(100vh - 180px); display: grid; place-items: center; padding: 20px 0 60px; }
.auth-card { width: min(460px, 100%); padding: 34px; }
.auth-card.register-card { width: min(680px, 100%); }
.auth-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 13px; color: white; background: linear-gradient(135deg, var(--primary), #07457c); font-size: .8rem; font-weight: 800; }
.auth-card h1 { margin: 0; font-size: 1.75rem; letter-spacing: -.035em; }
.auth-card > p { margin: 9px 0 24px; color: var(--text-muted); line-height: 1.55; }
.auth-card form > label, .auth-form-grid label { display: grid; gap: 7px; margin-bottom: 15px; color: var(--text); font-size: .76rem; font-weight: 700; }
.auth-card input { width: 100%; min-height: 43px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: white; }
.auth-card input:focus { outline: 2px solid #cae3ff; border-color: var(--primary); }
.auth-card .remember { display: flex; align-items: center; flex-direction: row; gap: 9px; font-weight: 500; }
.auth-card .remember input { width: 17px; min-height: auto; }
.auth-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.auth-form-grid .wide { grid-column: 1 / -1; }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-switch { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .78rem; text-align: center; }
.auth-switch a { font-weight: 750; text-decoration: none; }
.password-hint { margin: -2px 0 14px !important; font-size: .7rem; }
.registration-visibility { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; margin: 2px 0 14px !important; padding: 12px; border: 1px solid #d7e7f5; border-radius: 9px; background: #f2f8fd; }
.registration-visibility input { width: 17px; height: 17px; }
.registration-visibility strong, .registration-visibility small { display: block; }
.registration-visibility small { margin-top: 3px; color: var(--text-muted); font-weight: 400; line-height: 1.4; }
.team-card { overflow: hidden; }
.team-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--border); }
.team-card > header h2, .team-card > header p { margin: 0; }
.team-card > header p { margin-top: 4px; color: var(--text-muted); }
.team-list article { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.team-list article p { margin: 3px 0 0; color: var(--text-muted); }
.team-list article > b { padding: 5px 8px; border-radius: 999px; color: #176dcc; background: #e9f3ff; font-size: .68rem; }
.team-card > aside { display: grid; grid-template-columns: auto 1fr 1fr 1fr; gap: 14px; padding: 16px 18px; background: #f6f9fb; }
.team-card > aside span { color: var(--text-muted); font-size: .7rem; line-height: 1.45; }
.team-card > aside span b { display: block; color: var(--text); }
.team-password-note { margin: 0; color: var(--text-muted); font-size: .7rem; line-height: 1.45; }
.collaboration-layout { display: grid; grid-template-columns: minmax(330px,.75fr) minmax(0,1.25fr); gap: 14px; align-items: start; }
.group-list, .group-detail, .chat-contacts, .chat-panel { overflow: hidden; }
.group-list > header, .chat-contacts > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); }
.group-list h2, .group-list p, .chat-contacts h2, .chat-contacts p { margin: 0; }
.group-list p, .chat-contacts p { margin-top: 3px; color: var(--text-muted); }
.group-list > button, .chat-contacts > button { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--border); background: #fff; text-align: left; }
.group-list > button.active, .group-list > button:hover, .chat-contacts > button.active, .chat-contacts > button:hover { background: #eef6ff; }
.group-list small, .group-list strong, .chat-contacts small, .chat-contacts strong { display: block; }
.group-list small, .chat-contacts small { color: var(--text-muted); }
.group-detail { padding: 20px; }
.group-detail h2 { margin: 4px 0; }
.group-detail > p { color: var(--text-muted); }
.group-member { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.group-member b { color: #08775e; font-size: .65rem; }
.group-detail > label { display: grid; gap: 5px; margin: 16px 0 8px; font-size: .7rem; font-weight: 700; }
.group-detail select { padding: 9px; border: 1px solid var(--border); border-radius: 7px; }
.chat-panel > header { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.chat-panel header strong, .chat-panel header small { display: block; }
.chat-panel header small { color: var(--text-muted); }
.message-stream { display: grid; align-content: end; gap: 8px; min-height: 360px; max-height: 520px; overflow: auto; padding: 16px; background: #f5f8fb; }
.message-stream article { max-width: 75%; padding: 9px 11px; border-radius: 10px 10px 10px 2px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.message-stream article.own { justify-self: end; border-radius: 10px 10px 2px 10px; color: #fff; background: #087bea; }
.message-stream article small { opacity: .75; font-size: .6rem; }
.message-stream article p { margin: 3px 0 0; line-height: 1.4; }
.chat-panel > footer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-panel textarea { min-height: 55px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
@media (max-width: 850px) { .collaboration-layout { grid-template-columns: 1fr; } .team-card > aside { grid-template-columns: 1fr; } }
.form-error { margin-bottom: 15px; padding: 11px 12px; border-radius: 8px; color: #a12329; background: #fff0f0; font-size: .76rem; }
.validation-message { display: block; margin-top: .3rem; color: var(--danger); font-size: .72rem; font-weight: 700; }
.required-mark { color: var(--danger); font-weight: 900; }
.required-note { margin: 0 0 .75rem; color: var(--muted); font-size: .72rem; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 12%, transparent); }
.locked-field input[readonly] { background: #f2f6fa; color: #49657c; cursor: not-allowed; }
.locked-field small { display: block; margin-top: .3rem; color: var(--muted); font-size: .7rem; font-weight: 500; }

.loading-progress { position: absolute; display: block; width: 8rem; height: 8rem; inset: 20vh 0 auto; margin: 0 auto; }
.loading-progress circle { fill: none; stroke: #d9e3ec; stroke-width: .6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--primary); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%)), 500%; transition: stroke-dasharray .05s ease-in-out; }
.loading-progress-text { position: absolute; inset: calc(20vh + 3.25rem) 0 auto; text-align: center; font-weight: bold; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Laden"); }
#blazor-error-ui { display: none; position: fixed; z-index: 1000; right: 18px; bottom: 18px; padding: 14px 48px 14px 18px; border-radius: 8px; color: #442c00; background: #fff2bd; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
#blazor-error-ui .dismiss { position: absolute; right: 14px; cursor: pointer; }

@media (max-width: 1100px) {
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .workflow { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .page-header { align-items: flex-start; flex-direction: column; }
    .metrics, .workflow { grid-template-columns: 1fr; }
    .data-table { min-width: 760px; }
    .table-card { overflow-x: auto; }
    .auth-card { padding: 24px; }
    .auth-form-grid { grid-template-columns: 1fr; }
    .auth-form-grid .wide { grid-column: auto; }
}
@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body.protocol-print-mode {
        margin: 0;
        background: #fff;
    }

    body.protocol-print-mode * {
        visibility: hidden !important;
    }

    body.protocol-print-mode .protocol-print-selected,
    body.protocol-print-mode .protocol-print-selected * {
        visibility: visible !important;
    }

    body.protocol-print-mode .protocol-print-selected {
        position: absolute;
        top: 0;
        left: 0;
        box-sizing: border-box;
        width: 100%;
        color: #111827;
        background: #fff;
        font-family: Arial, sans-serif;
        font-size: 9pt;
        line-height: 1.35;
    }

    body.protocol-print-mode .print-document-head {
        display: grid;
        grid-template-columns: .8fr 1.2fr;
        gap: 10mm;
        margin-bottom: 6mm;
        padding-bottom: 5mm;
        border-bottom: 1.5pt solid #145f9f;
    }

    body.protocol-print-mode .print-document-head span {
        color: #145f9f;
        font-size: 8pt;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    body.protocol-print-mode .print-document-head h1 {
        margin: 2mm 0 1mm;
        font-size: 20pt;
    }

    body.protocol-print-mode .print-document-head p {
        margin: 0;
    }

    body.protocol-print-mode .print-document-head dl {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2mm 5mm;
        margin: 0;
    }

    body.protocol-print-mode .print-document-head dt {
        color: #5b6875;
        font-size: 7pt;
    }

    body.protocol-print-mode .print-document-head dd {
        margin: 1mm 0 0;
        font-weight: 700;
    }

    body.protocol-print-mode .protocol-head {
        padding: 0 0 4mm;
    }

    body.protocol-print-mode .protocol-head button,
    body.protocol-print-mode .protocol-actions,
    body.protocol-print-mode .signature-box,
    body.protocol-print-mode .onsite-start,
    body.protocol-print-mode .file-button,
    body.protocol-print-mode .upload-locked {
        display: none !important;
    }

    body.protocol-print-mode .condition-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 3mm !important;
        padding: 0 !important;
    }

    body.protocol-print-mode .condition {
        break-inside: avoid;
        min-height: 17mm;
        padding: 3mm !important;
        border: 1px solid #cbd5df !important;
        background: #fff !important;
    }

    body.protocol-print-mode .condition.wide {
        grid-column: 1 / -1 !important;
    }

    body.protocol-print-mode .info-box,
    body.protocol-print-mode .print-checklist,
    body.protocol-print-mode .signature-line,
    body.protocol-print-mode .protocol-files {
        break-inside: avoid;
        margin: 4mm 0 0 !important;
        padding: 3mm !important;
        border: 1px solid #cbd5df !important;
        background: #fff !important;
    }

    body.protocol-print-mode .print-checklist {
        display: block;
    }

    body.protocol-print-mode .signature-line {
        display: grid !important;
        grid-template-columns: 6mm 1fr 48mm !important;
    }

    body.protocol-print-mode .signature-line img {
        height: 18mm !important;
        border: 0 !important;
    }

    body.protocol-print-mode .protocol-files a {
        color: #111827 !important;
        text-decoration: none !important;
    }

    body.protocol-print-mode .print-document-foot {
        display: flex;
        justify-content: space-between;
        gap: 8mm;
        margin-top: 6mm;
        padding-top: 3mm;
        border-top: 1px solid #9aa8b5;
        color: #5b6875;
        font-size: 7pt;
        overflow-wrap: anywhere;
    }
}

.review-settings-body,
.moderation-review-card {
    display: grid;
    gap: 16px;
    padding: 22px;
}

.review-count-preview,
.review-summary,
.review-card > header,
.review-card > footer,
.moderation-review-card > header,
.moderation-review-card > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.review-summary {
    justify-content: flex-start;
}

.review-count-preview span,
.review-summary span {
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef5fb;
    font-weight: 700;
}

.company-reviews {
    margin: 18px 0;
}

.company-review-list,
.moderation-review-list {
    display: grid;
    gap: 14px;
}

.review-card {
    padding: 18px;
    border-left: 4px solid #8a9aaa;
    background: #fff;
}

.review-card.positive { border-left-color: #0d9b74; }
.review-card.neutral { border-left-color: #d49a19; }
.review-card.negative { border-left-color: #d14b4b; }

.review-card time,
.review-card footer span,
.review-privacy-note {
    color: var(--text-muted);
}

.review-report-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.review-report-form textarea,
.moderation-review-card textarea {
    width: 100%;
    min-height: 90px;
    box-sizing: border-box;
}

.company-profile-page .fleet-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 520px)) !important;
    justify-content: start;
}

.company-profile-page .fleet-profile-card .trailer-photo img {
    object-fit: contain;
}

.company-profile-page .profile-section.about > p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.request-grid > label {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    width: 100%;
}

.request-grid > label > input,
.request-grid > label > select,
.request-grid > label > textarea,
.request-grid > label > small,
.request-grid > label > .validation-message {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}
