:root {
    color-scheme: light;
    --bg: #f3f0ea;
    --surface: #ffffff;
    --surface-soft: #faf8f3;
    --text: #171717;
    --muted: #6b7280;
    --line: #e2ded3;
    --accent: #101010;
    --accent-red: #c1122f;
    --gold: #b08a3c;
    --shadow: 0 18px 45px rgba(20, 20, 20, .08);
    --danger: #b91c1c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, .86);
    border-bottom: 1px solid rgba(226, 222, 211, .85);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    align-items: center;
    display: flex;
    gap: 12px;
    font-weight: 700;
    text-decoration: none;
}

.brand img {
    height: 28px;
    max-width: 150px;
    object-fit: contain;
}

.brand span {
    border-left: 1px solid var(--line);
    padding-left: 12px;
}

.nav {
    display: flex;
    gap: 6px;
    font-size: 14px;
}

.nav a {
    border-radius: 999px;
    color: #343434;
    padding: 8px 12px;
    text-decoration: none;
}

.nav a:hover {
    background: #f2efe8;
}

.container {
    margin: 0 auto;
    max-width: 1500px;
    padding: 34px 20px 64px;
}

.hero,
.section-head {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 22px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(32px, 4vw, 58px);
    line-height: 1.1;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
}

.eyebrow {
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

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

.panel,
.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.login-card {
    margin: 7vh auto 0;
    max-width: 460px;
    position: relative;
}

.login-card::before {
    background: linear-gradient(90deg, var(--accent-red), #101010, var(--gold));
    border-radius: 14px 14px 0 0;
    content: "";
    height: 5px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.login-logo {
    display: block;
    height: auto;
    margin-bottom: 22px;
    max-width: 185px;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.stat {
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(20, 20, 20, .05);
    padding: 18px;
}

.stat span {
    display: block;
    font-size: 34px;
    font-weight: 700;
}

.stat-highlight {
    background: #101010;
    color: #fff;
}

.stat-highlight small {
    color: rgba(255, 255, 255, .68);
}

.hero-dashboard {
    background: #101010;
    border-radius: 18px;
    box-shadow: var(--shadow);
    color: #fff;
    overflow: hidden;
    padding: 34px;
    position: relative;
}

.hero-dashboard::after {
    background: linear-gradient(135deg, rgba(193, 18, 47, .95), rgba(176, 138, 60, .7));
    content: "";
    height: 180px;
    position: absolute;
    right: -60px;
    top: -70px;
    transform: rotate(18deg);
    width: 220px;
}

.hero-dashboard > * {
    position: relative;
    z-index: 1;
}

.hero-dashboard p {
    color: rgba(255, 255, 255, .72);
    max-width: 620px;
}

.hero-actions {
    display: flex;
    gap: 10px;
}

.progress-panel {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    grid-template-columns: 220px minmax(180px, 1fr) 1.4fr;
    margin-bottom: 22px;
    padding: 22px;
}

.progress-panel h2 {
    margin-bottom: 0;
}

.progress-track {
    background: #ebe7dc;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.progress-track span {
    background: linear-gradient(90deg, var(--accent-red), var(--gold));
    border-radius: inherit;
    display: block;
    height: 100%;
}

.status-pills,
.mini-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill,
.type-badge,
.priority,
.badge,
.person-chip {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
    line-height: 1;
    min-height: 28px;
    padding: 7px 10px;
    white-space: nowrap;
}

.pill,
.badge {
    background: #eee9dd;
    color: #34302a;
}

.status-bestaetigt {
    background: #e7f6ed;
    color: #126334;
}

.status-angefragt,
.status-follow-up {
    background: #fff4d8;
    color: #7a4a00;
}

.status-abgelehnt,
.status-nicht-relevant {
    background: #fbe4e4;
    color: #8d1d1d;
}

.type-badge {
    background: #111;
    color: #fff;
}

.type-party {
    background: var(--accent-red);
}

.type-praesentation,
.type-showroom {
    background: #5a4630;
}

.priority {
    background: #f1eee7;
    color: #38332a;
}

.priority-hoch {
    background: #111;
    color: #fff;
}

.priority-vielleicht {
    background: #fff2cc;
    color: #6d4500;
}

.person-chip {
    background: #f4f1ea;
    color: #292724;
    font-weight: 600;
}

.person-chip small {
    color: #7d7568;
    font-size: 10px;
    text-transform: uppercase;
}

.empty-chip {
    color: #918878;
}

.avatar {
    align-items: center;
    background: #101010;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: 10px;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.grid-two {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

.dashboard-grid {
    align-items: start;
}

.form {
    display: grid;
    gap: 14px;
}

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

.form-row,
.button-row {
    display: flex;
    gap: 10px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    gap: 6px;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
    outline: 0;
}

textarea {
    resize: vertical;
}

.button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--accent);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    text-decoration: none;
}

.button.primary {
    background: var(--accent);
    color: #fff;
}

.button.ghost {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .4);
    color: #fff;
}

.button:hover {
    transform: translateY(-1px);
}

.button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    padding: 10px 12px;
}

.filters {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    margin-bottom: 16px;
}

.quick-add {
    margin-bottom: 18px;
}

.import-panel + .import-panel {
    margin-top: 18px;
}

.table-wrap {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
}

.bulk-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 12px;
}

.row-check {
    cursor: pointer;
    height: 18px;
    min-height: 0;
    width: 18px;
}

.plan-table {
    border-collapse: separate;
    border-spacing: 0 18px;
    min-width: 980px;
    width: 100%;
}

.plan-table th,
.plan-table td {
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
}

.plan-table th {
    background: transparent;
    color: #7a7265;
    font-size: 12px;
    text-transform: uppercase;
}

.plan-table tbody tr:hover {
    background: transparent;
}

.event-main-row td {
    background: #fff;
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(20, 20, 20, .05);
}

.event-main-row td:first-child {
    border-bottom-left-radius: 14px;
    border-left: 1px solid var(--line);
    border-top-left-radius: 14px;
}

.event-main-row td:last-child {
    border-bottom-right-radius: 14px;
    border-right: 1px solid var(--line);
    border-top-right-radius: 14px;
}

.interest-stack {
    display: flex;
    gap: 7px;
    min-width: 118px;
}

.interest-form {
    margin: 0;
}

.interest-dot {
    align-items: center;
    background: #ebe6dc;
    border: 1px solid #d6cec0;
    border-radius: 50%;
    color: #8a8172;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 32px;
}

.interest-dot:hover,
.interest-dot:focus {
    border-color: #111;
    color: #111;
    outline: 0;
}

.interest-interessiert {
    background: #111;
    border-color: #111;
    color: #fff;
}

.interest-vielleicht {
    background: #fff4d8;
    border-color: #e8cd7a;
    color: #7a4a00;
}

.interest-kein-interesse {
    background: #fbe4e4;
    border-color: #efb7b7;
    color: #8d1d1d;
}

.empty-chip {
    opacity: .55;
}

.inline-form {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    margin: 0;
}

.inline-select {
    appearance: none;
    background: #eee9dd;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #34302a;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    min-height: 32px;
    padding: 6px 24px 6px 10px;
    width: auto;
}

.inline-select:hover,
.inline-select:focus {
    border-color: #111;
}

.inline-save {
    display: none;
}

.inline-form .status-bestaetigt,
.inline-form .priority-hoch,
.inline-form .interest-interessiert {
    background: #e7f6ed;
    color: #126334;
}

.inline-form .status-angefragt,
.inline-form .status-pruefen,
.inline-form .priority-vielleicht,
.inline-form .interest-vielleicht {
    background: #fff4d8;
    color: #7a4a00;
}

.inline-form .status-abgelehnt,
.inline-form .status-nicht-relevant,
.inline-form .priority-kein-interesse,
.inline-form .interest-kein-interesse {
    background: #fbe4e4;
    color: #8d1d1d;
}

.inline-form .interest-offen {
    background: #e8e3d8;
    color: #8b8172;
}

.missing-time {
    background: #fbe4e4;
    border-radius: 999px;
    color: #8d1d1d;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
}

.time-value {
    font-size: 15px;
    white-space: nowrap;
}

.plan-table td small {
    display: block;
}

.event-title {
    display: block;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 6px;
}

.event-details summary {
    cursor: pointer;
    list-style: none;
}

.event-details summary::-webkit-details-marker {
    display: none;
}

.event-meta-line {
    color: #7a7265;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 5px 12px;
    line-height: 1.35;
}

.event-detail-panel {
    background: #f8f5ee;
    border: 1px solid #e5dccf;
    border-radius: 10px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
    padding: 14px;
}

.event-detail-panel p {
    margin-bottom: 0;
}

.event-meta-line span {
    display: inline-flex;
    min-width: 0;
}

.event-meta-line b {
    color: #282521;
    margin-right: 4px;
}

.team-stack {
    display: grid;
    gap: 6px;
    min-width: 150px;
}

.request-row {
    display: flex;
    gap: 5px;
    padding-left: 42px;
}

.flag-form {
    margin: 0;
}

.flag-button {
    background: #eee9dd;
    border: 1px solid #d8d0c2;
    border-radius: 999px;
    color: #8a8172;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
    padding: 5px 8px;
}

.flag-button.is-active {
    background: #111;
    border-color: #111;
    color: #fff;
}

.person-inline-form {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: 36px minmax(90px, 1fr);
    margin: 0;
}

.person-inline-form span {
    color: #7a7265;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.person-inline-select {
    background: #f4f1ea;
    border: 1px solid #ded6c9;
    border-radius: 999px;
    color: #292724;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    min-height: 31px;
    padding: 6px 10px;
    width: 100%;
}

.delete-link {
    align-items: center;
    border: 1px solid #efb7b7;
    border-radius: 50%;
    color: var(--danger);
    display: inline-flex;
    font-size: 18px;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    width: 30px;
}

.delete-link:hover {
    background: #fbe4e4;
}

.row-actions {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: flex-end;
    min-width: 120px;
}

.event-card {
    align-items: flex-start;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 0;
}

.event-card h3 {
    margin-bottom: 4px;
}

.event-card time,
.timeline time {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

.checkbox-grid label {
    align-items: center;
    display: flex;
}

.checkbox-grid input {
    min-height: auto;
    width: auto;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(20, 20, 20, .05);
    display: grid;
    gap: 16px;
    grid-template-columns: 170px 1fr;
    padding: 18px;
}

.empty {
    color: var(--muted);
    margin: 0;
}

@media (max-width: 760px) {
    .topbar,
    .hero,
    .section-head,
    .form-row,
    .button-row {
        align-items: stretch;
        flex-direction: column;
    }

    .nav {
        flex-wrap: wrap;
    }

    .brand {
        align-items: flex-start;
    }

    .brand span {
        border-left: 0;
        padding-left: 0;
    }

    .stats-grid,
    .grid-two,
    .form-grid,
    .filters,
    .checkbox-grid,
    .progress-panel,
    .timeline-item {
        grid-template-columns: 1fr;
    }

    .hero-dashboard {
        padding: 24px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .plan-table,
    .plan-table thead,
    .plan-table tbody,
    .plan-table th,
    .plan-table td,
    .plan-table tr {
        display: block;
        min-width: 0;
    }

    .plan-table thead {
        display: none;
    }

    .plan-table tr {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(20, 20, 20, .05);
        margin-bottom: 14px;
        padding: 12px;
    }

    .plan-table td {
        background: transparent;
        border: 0;
        box-shadow: none;
        display: grid;
        gap: 8px;
        grid-template-columns: 105px 1fr;
        padding: 6px 0;
    }

    .plan-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .event-main-row td:first-child,
    .event-main-row td:last-child {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

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

@media print {
    .topbar,
    .filters,
    .button-row {
        display: none;
    }

    body {
        background: #fff;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}
