:root {
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --pos: #16a34a;
    --neg: #dc2626;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-text-size-adjust: 100%;
}

.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.trip-code {
    font-size: 0.9rem;
    color: var(--muted);
}

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

h1 {
    font-size: 1.25rem;
    margin: 0 0 12px;
}

h2 {
    font-size: 1.05rem;
    margin: 0 0 12px;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 4px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px;
    background: #fff;
    color: var(--text);
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #e5e7eb;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

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

.btn.primary:hover { background: var(--primary-dark); }

.btn.danger {
    background: transparent;
    color: var(--danger);
}

.btn.small {
    padding: 4px 10px;
    font-size: 0.85rem;
}

.error {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.kasse-stand {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.kasse-stand > div {
    flex: 1;
    min-width: 100px;
    text-align: center;
    background: var(--bg);
    border-radius: 10px;
    padding: 10px;
}

.kasse-stand .label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.kasse-stand .amount {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

.amount.neg { color: var(--neg); }
.amount.pos { color: var(--pos); }

.settlement-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.settlement-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.settlement-list li:last-child { border-bottom: none; }

.who { font-weight: 600; }

.item-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.item-list li:last-child { border-bottom: none; }

.inline-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.inline-form input,
.inline-form select {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.inline-form.stacked {
    flex-direction: column;
}

.inline-form.stacked input {
    width: 100%;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
}

.checkbox-group .label {
    width: 100%;
    font-size: 0.85rem;
    color: var(--muted);
    margin: 4px 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    background: var(--bg);
    padding: 6px 10px;
    border-radius: 20px;
}

.checkbox-item input {
    width: auto;
    margin: 0;
}

@media (max-width: 480px) {
    .inline-form {
        flex-direction: column;
    }
    .inline-form input,
    .inline-form select,
    .inline-form button {
        width: 100%;
    }
}
