:root {
    --bg: #f3f5f7;
    --panel: #ffffff;
    --panel-soft: #eef3f1;
    --line: #d7e0db;
    --text: #132025;
    --muted: #61727c;
    --accent: #0f766e;
    --accent-dark: #0b554f;
    --warn: #b45309;
    --danger: #b42318;
    --best: #dff6eb;
}

body {
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 28%),
        linear-gradient(180deg, #eef3f1 0%, var(--bg) 55%, #e8edee 100%);
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

.sidebar {
    background: linear-gradient(180deg, #163035 0%, #11262b 100%);
    color: #fff;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.88);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-brand h1,
.auth-panel h1 {
    font-family: Georgia, "Times New Roman", serif;
}

.sidebar-kicker,
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: var(--muted);
}

.sidebar-user {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
}

.content-area {
    padding: 2rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.topbar-title {
    font-size: 1.8rem;
    font-weight: 700;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card,
.supplier-card,
.winner-card,
.approval-card {
    background: var(--panel);
    border: 1px solid rgba(19, 32, 37, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 20px 40px rgba(19, 32, 37, 0.06);
}

.stat-card {
    padding: 1.25rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.stat-card strong {
    font-size: 2rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.section-heading h2 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.supplier-card {
    padding: 1.25rem;
    height: 100%;
}

.supplier-card-header,
.key-value,
.supplier-summary div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.supplier-index,
.best-badge {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.best-badge {
    color: var(--accent-dark);
    font-weight: 700;
}

.supplier-card-best,
.winner-card.is-best {
    background: linear-gradient(180deg, #f5fbf7 0%, var(--best) 100%);
    border-color: rgba(15, 118, 110, 0.3);
}

.supplier-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 0.5rem;
}

.summary-end {
    padding-top: 0.5rem;
    border-top: 1px dashed var(--line);
}

.item-table textarea {
    min-width: 180px;
}

.price-cell {
    min-width: 170px;
}

.winner-card {
    padding: 1rem 1.25rem;
}

.comparison-winner-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.winner-total {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

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

.reason-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.reason-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.9rem;
    background: var(--panel-soft);
}

.approval-card {
    padding: 1.1rem;
}

.table-modern thead th {
    background: #eaf1ee;
    border-bottom: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.table-modern td,
.table-modern th {
    padding: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: #e9eff2;
}

.status-entwurf { background: #e9eff2; }
.status-vollstaendig { background: #dbeafe; }
.status-zur_pruefung { background: #fff1cc; }
.status-freigegeben,
.status-zugelassen { background: #dff6eb; }
.status-auftrag_vergeben { background: #dff1ff; }
.status-storniert,
.status-kein_angebot,
.status-nicht_zugelassen { background: #fde8e8; }

.offer-ocr-status {
    min-height: 1.25rem;
}

.auth-shell,
.error-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-panel {
    width: min(100%, 520px);
    background: var(--panel);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 30px 60px rgba(19, 32, 37, 0.08);
}

.auth-panel-wide {
    width: min(100%, 760px);
}

.print-page {
    background: #fff;
    color: #000;
}

.print-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem;
}

.print-header h1 {
    font-family: Georgia, serif;
    margin: 1rem 0;
}

.print-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
    margin-bottom: 1.5rem;
}

.print-table th,
.print-table td {
    font-size: 0.9rem;
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    margin-top: 5rem;
}

@media (max-width: 1399px) {
    .comparison-winner-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1199px) {
    .content-area {
        padding: 1.25rem;
    }

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

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .print-wrapper {
        padding: 0;
    }
}
