:root {
    color-scheme: light;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f6f8;
    color: #17202a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
}

a {
    color: inherit;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem max(1rem, calc((100% - 1180px) / 2));
    background: #ffffff;
    border-bottom: 1px solid #dce2e8;
}

.topbar h1,
.login-card h1 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 0.25rem;
    color: #66717d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.dashboard {
    width: min(1180px, calc(100% - 2rem));
    margin: 2rem auto 4rem;
}

.summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.summary div {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.summary strong {
    font-size: 2rem;
}

.summary p {
    margin: 0;
    color: #66717d;
}

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto auto;
    gap: 0.8rem;
    align-items: end;
    padding: 1rem;
    margin-bottom: 1.25rem;
    background: #ffffff;
    border: 1px solid #dce2e8;
    border-radius: 12px;
}

.filters label {
    display: grid;
    gap: 0.35rem;
    color: #4d5965;
    font-size: 0.82rem;
    font-weight: 700;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 0.75rem;
    background: #ffffff;
    border: 1px solid #cbd3db;
    border-radius: 8px;
}

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

.job-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 1.5rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #dce2e8;
    border-radius: 12px;
}

.job-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.job-heading h2 {
    margin: 0.45rem 0 0.2rem;
    font-size: 1.2rem;
}

.job-heading time {
    color: #66717d;
    font-size: 0.85rem;
    white-space: nowrap;
}

.company {
    margin: 0;
    color: #4d5965;
}

.metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.metadata span {
    padding: 0.35rem 0.55rem;
    background: #f0f3f6;
    border-radius: 6px;
    color: #47515c;
    font-size: 0.82rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #e8eef5;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-gemerkt {
    background: #fff1bf;
}

.status-beworben {
    background: #d9f5e5;
}

.status-ignoriert {
    background: #eceff2;
}

details {
    margin-top: 0.75rem;
}

summary {
    cursor: pointer;
    color: #315b86;
    font-weight: 700;
}

.description {
    max-height: 420px;
    overflow: auto;
    margin-top: 1rem;
    padding: 1rem;
    background: #f7f9fb;
    border-radius: 8px;
    line-height: 1.55;
    white-space: normal;
}

.job-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.job-actions form {
    display: contents;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 0.6rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
}

.button-primary {
    background: #1f5f99;
    color: #ffffff;
}

.button-secondary {
    background: #ffffff;
    color: #26323d;
    border-color: #cbd3db;
}

.empty-state,
.login-card {
    padding: 2rem;
    background: #ffffff;
    border: 1px solid #dce2e8;
    border-radius: 12px;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(460px, 100%);
}

.login-card p {
    line-height: 1.55;
}

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

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

    .job-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .topbar,
    .summary,
    .job-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .filters,
    .job-actions {
        grid-template-columns: 1fr;
    }

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

.job-dates {
    display: grid;
    gap: 0.25rem;
    color: #66717d;
    font-size: 0.82rem;
    text-align: right;
}

.job-dates time {
    white-space: nowrap;
}

.analysis-box {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: #f7f9fb;
    border: 1px solid #dce2e8;
    border-radius: 8px;
}

.analysis-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.analysis-box p {
    margin: 0.7rem 0 0.4rem;
    line-height: 1.5;
}

.analysis-box small {
    color: #66717d;
}

.analysis-decision,
.analysis-priority {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #e8eef5;
    font-size: 0.75rem;
    font-weight: 700;
}

.analysis-decision-bewerben {
    background: #d9f5e5;
}

.analysis-decision-prüfen {
    background: #fff1bf;
}

.analysis-decision-nicht_bewerben {
    background: #eceff2;
}

.dashboard-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-tools span {
    color: #66717d;
    font-size: 0.88rem;
}

@media (max-width: 560px) {
    .dashboard-tools {
        align-items: stretch;
        flex-direction: column;
    }
}

.analysis-upload-form {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    margin-left: auto;
}

.analysis-upload-form label {
    display: grid;
    gap: 0.35rem;
    color: #4d5965;
    font-size: 0.82rem;
    font-weight: 700;
}

.analysis-upload-form input[type="file"] {
    max-width: 320px;
    padding: 0.45rem;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid;
    border-radius: 8px;
}

.flash-success {
    background: #eaf7ef;
    border-color: #b9dfc6;
}

.flash-error {
    background: #fff0f0;
    border-color: #e5b5b5;
}

.flash ul {
    margin-bottom: 0;
}

@media (max-width: 850px) {
    .dashboard-tools,
    .analysis-upload-form {
        align-items: stretch;
        flex-direction: column;
    }

    .analysis-upload-form {
        margin-left: 0;
    }

    .analysis-upload-form input[type="file"] {
        max-width: none;
    }
}
