:root {
    color-scheme: light;
    font-family: Inter, system-ui, sans-serif;
    color: #2f2a24;
    background: #948e87;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #948e87;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 4vw;
    color: #f3eadc;
    background: #68615b;
}

header h1 {
    margin: 0;
    color: #caa15f;
}

header p {
    margin: 5px 0 0;
    color: #ddd2c3;
}

.status {
    padding: 8px 13px;
    border-radius: 999px;
    color: #3d321d;
    background: #d7c58f;
    font-weight: 700;
}

.workspace {
    display: grid;
    grid-template-columns:
        minmax(300px, 0.85fr)
        minmax(400px, 1.15fr);
    gap: 24px;
    padding: 28px 4vw;
    align-items: start;
}

.panel {
    min-width: 0;
    padding: 26px;
    border-radius: 13px;
    background: #c9c1b7;
    box-shadow: 0 5px 22px #2a211a33;
}

.panel h2,
.panel h3,
.panel h4,
dt,
summary {
    color: #9a6f2f;
}

.panel h2 {
    margin-top: 0;
}

.panel h3 {
    margin-top: 26px;
    margin-bottom: 12px;
}

.panel h4 {
    margin-top: 18px;
    margin-bottom: 8px;
}

.dropzone {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    padding: 25px;
    border: 2px dashed #8f744e;
    border-radius: 12px;
    background: #dad1c7;
    cursor: pointer;
    text-align: center;
}

.dropzone:hover {
    border-color: #a37d3e;
    background: #e0d7cd;
}

.dropzone.dragover {
    border-color: #b48842;
    background: #e9dfd1;
    transform: scale(1.01);
}

.dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.selected-file {
    overflow-wrap: anywhere;
    color: #5f574f;
}

button {
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 8px;
    color: #f8f2e8;
    background: #9a7437;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #7e5d2e;
}

.notice,
.message {
    margin-top: 18px;
    padding: 13px;
    border-radius: 8px;
}

.notice {
    color: #4b443c;
    background: #d6cec5;
}

.error {
    color: #6d2525;
    background: #d9b8b4;
}

.fields,
.technical {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px 18px;
}

dt {
    font-weight: 700;
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.mail-body {
    max-height: 380px;
    overflow: auto;
    padding: 15px;
    border-radius: 8px;
    background: #dad1c7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
}

.attachments {
    padding-left: 20px;
}

.attachments li {
    margin-bottom: 18px;
}

.empty-result {
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 30px;
    border-radius: 10px;
    color: #5d554c;
    background: #dad1c7;
    text-align: center;
}

details {
    margin-top: 25px;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

.technical {
    margin-top: 15px;
    font-size: 0.9rem;
}

.hash {
    font-family: monospace;
}

.workflow-next {
    margin-top: 22px;
}

.workflow-next button {
    min-height: 46px;
}

.order-review {
    grid-column: 1 / -1;
}

.order-status-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.order-grün {
    color: #25400d;
    background: #cce9aa;
}

.order-gelb {
    color: #5a4300;
    background: #ead58f;
}

.order-rot {
    color: #6d2525;
    background: #d9b8b4;
}

.order-warning {
    color: #5f4a1f;
    background: #e2d2ad;
}

.order-form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(220px, 1fr));
    gap: 16px 20px;
}

.order-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.order-form-grid label span {
    color: #9a6f2f;
    font-weight: 700;
}

.order-form-grid input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #9d8b73;
    border-radius: 7px;
    color: #2f2a24;
    background: #d8cec3;
    font: inherit;
}

.order-form-grid input:focus {
    outline: 2px solid #b48842;
    outline-offset: 1px;
}

.order-form-grid input::placeholder {
    color: #786f66;
}

.order-wide {
    grid-column: 1 / -1;
}

.order-position {
    margin-top: 14px;
    padding: 18px;
    border: 1px solid #9d8b73;
    border-radius: 10px;
    background: #cfc5ba;
}

.order-position-title {
    margin-bottom: 14px;
    color: #9a6f2f;
    font-weight: 800;
}

.order-footer {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(220px, 320px);
    gap: 20px;
    align-items: center;
    margin-top: 24px;
}

.order-footer button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

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

    .order-review {
        grid-column: auto;
    }

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

    .order-wide {
        grid-column: auto;
    }

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

.source-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #4b443c;
    background: #d8cec3;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.source-selectline {
    color: #5a4300;
    background: #ead58f;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.version {
    color: #ddd2c3;
    font-size: 0.82rem;
    font-weight: 700;
}

.case-list-panel {
    grid-column: 1 / -1;
}

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

.case-list-header h2 {
    margin-bottom: 4px;
}

.case-list-header p {
    margin: 0;
    opacity: 0.78;
}

.case-count {
    white-space: nowrap;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    font-weight: 700;
}


.case-list-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.case-filters {
    display: flex;
    align-items: center;
    gap: 6px;
}

.case-filter {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
}

.case-filter:hover {
    background: rgba(255, 255, 255, 0.40);
}

.case-filter.active {
    background: rgba(75, 63, 49, 0.18);
}

.case-list {
    display: grid;
    gap: 6px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 6px;
}

.case-row {
    display: grid;
    grid-template-columns:
        90px
        120px
        minmax(150px, 1.1fr)
        minmax(180px, 1.35fr)
        minmax(240px, 2fr)
        minmax(120px, 0.9fr)
        minmax(150px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.30);
    color: inherit;
    text-decoration: none;
}

a.case-row:hover {
    background: rgba(255, 255, 255, 0.46);
}

.case-row-head {
    position: sticky;
    top: 0;
    z-index: 5;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(218, 207, 192, 0.98);
}

.case-status {
    display: inline-block;
    min-width: 54px;
    padding: 5px 8px;
    border-radius: 999px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.case-green {
    background: #cfe7c7;
    color: #294a22;
}

.case-yellow {
    background: #f3dfa1;
    color: #67500c;
}

.case-red {
    background: #e9b9b3;
    color: #70251d;
}

.case-subject {
    font-weight: 650;
}

.case-date {
    font-size: 0.88rem;
}

@media (max-width: 950px) {
    .case-row {
        grid-template-columns: 80px 100px 1fr;
    }

    .case-row > div:nth-child(3),
    .case-row > div:nth-child(4),
    .case-row > div:nth-child(6),
    .case-row > div:nth-child(7) {
        display: none;
    }
}

.source-filter-separator {
    width: 1px;
    height: 24px;
    margin: 0 6px;
    background: rgba(86, 60, 39, 0.35);
    align-self: center;
}

.source-filter-webshop {
    font-weight: 800;
    border: 1px solid rgba(86, 60, 39, 0.45);
    background: rgba(255, 255, 255, 0.42);
}

.source-filter-webshop:hover {
    background: rgba(255, 255, 255, 0.58);
}

.source-filter-webshop.active {
    background: rgba(86, 60, 39, 0.82);
    color: #fff;
}

.source-switch {
    margin-top: 12px;
}

.source-switch-webshop {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.02em;
    background: rgba(93, 62, 37, 0.88);
    color: #fff;
    border: 1px solid rgba(93, 62, 37, 0.95);
    box-shadow: 0 2px 6px rgba(70, 45, 28, 0.18);
}

.source-switch-webshop:hover {
    background: rgba(76, 49, 29, 0.95);
}

.source-switch-webshop.active {
    background: rgba(52, 35, 22, 1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.source-switch-inline {
    display: flex;
    align-items: center;
    margin-right: 6px;
    padding-right: 14px;
    border-right: 1px solid rgba(110, 78, 51, 0.35);
}

.source-switch-webshop {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: #8b5e3b;
    color: #fff7ef;
    border: 1px solid #7a4f30;
    box-shadow: 0 1px 3px rgba(73, 46, 27, 0.18);
    transition: all 0.15s ease;
}

.source-switch-webshop:hover {
    background: #7c5233;
    color: #fffaf5;
}

.source-switch-webshop.active {
    background: #6d452a;
    color: #ffffff;
    border-color: #5c3922;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.source-switch-mail {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.30);
    color: #4f3423;
    border: 1px solid rgba(93, 62, 37, 0.35);
}

.source-switch-mail:hover {
    background: rgba(255, 255, 255, 0.46);
}

.source-switch-mail.active {
    background: #b47a34;
    color: #fff8ef;
    border-color: #9f6729;
}

.source-switch-inline {
    gap: 8px;
}

/* Mail.assist bleibt als Hauptnavigation immer im Goldton */
.source-switch-mail,
.source-switch-mail:hover,
.source-switch-mail.active {
    background: #b47a34;
    color: #fff8ef;
    border-color: #9f6729;
}
