:root {
    --primary: #1f5f6f;
    --primary-dark: #17454f;
    --bg: #f4f6f6;
    --card: #ffffff;
    --text: #1c1c1c;
    --muted: #6b7280;
    --danger: #b91c1c;
    --border: #e2e5e3;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 24px 16px 64px;
}

.wrap {
    max-width: 480px;
    margin: 0 auto;
}

.wrap.wide {
    max-width: 1040px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

h1 {
    font-size: 22px;
    margin: 0 0 4px;
}

h2 {
    font-size: 17px;
    margin: 0 0 20px;
    color: var(--muted);
    font-weight: 500;
}

h3 {
    font-size: 15px;
    margin: 0 0 10px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 18px 0 6px;
}

input[type="text"], input[type="password"], input[type="number"], select, input[type="date"] {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
    border: 1px solid #cfd4d1;
    border-radius: 10px;
    background: #fff;
}

button, .btn {
    display: inline-block;
    width: 100%;
    padding: 15px;
    margin-top: 22px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

button:active, .btn:active { background: var(--primary-dark); }

.btn.secondary {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn.danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
    margin-top: 0;
}

.meta {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}

.error-box {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: var(--danger);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.success-box {
    background: #eaf7ee;
    border: 1px solid #bfe6c8;
    color: #1f6f3f;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    background: #eef2f2;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.topnav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.topnav a { color: var(--primary); font-size: 14px; text-decoration: none; font-weight: 600; }
.topnav a:hover { text-decoration: underline; }
.topnav .sep { color: var(--border); }

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.filters .field { flex: 1; min-width: 140px; }
.filters label { margin: 0 0 6px; }
.filters button, .filters .btn { width: auto; margin-top: 0; padding: 12px 18px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.count-badge {
    background: #eef2f2;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
}

.role-badge {
    display: inline-block;
    background: #fff3d6;
    color: #8a5a00;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

/* Wochenmaske */

.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

.week-nav .btn { width: auto; margin-top: 0; padding: 10px 16px; }
.week-nav .week-label { font-weight: 700; font-size: 15px; text-align: center; }
.week-nav .week-label .meta { margin-top: 2px; }

.day-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.day-block h3 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: var(--text);
}

.day-block h3 .date {
    font-weight: 400;
    color: var(--muted);
    font-size: 13px;
}

.day-block h3 .day-hours {
    font-weight: 700;
    font-size: 13px;
    color: var(--primary-dark);
    background: #eef2f2;
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.entry-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.entry-row:first-of-type { border-top: none; }

.entry-row .field { flex: 3; min-width: 160px; }
.entry-row .field.hours { flex: 1; min-width: 90px; }
.entry-row .field.cc { flex: 2; min-width: 130px; }
.entry-row label { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.entry-row input { padding: 10px; font-size: 14px; }
.entry-row .row-actions { display: flex; gap: 8px; }
.entry-row button, .entry-row .btn { width: auto; margin-top: 0; padding: 10px 14px; font-size: 14px; }

.entry-row.new-row-start { border-top: 2px dashed var(--border); margin-top: 6px; padding-top: 14px; }

.batch-form .row-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.batch-form .row-actions .btn { width: auto; margin-top: 0; }
.add-row-btn { width: auto; margin-top: 0; padding: 10px 14px; font-size: 14px; }

.week-summary {
    text-align: right;
    font-weight: 700;
    padding: 10px 16px 0;
    color: var(--primary-dark);
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}
.checkbox-line label { margin: 0; font-weight: 500; }

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.inline-form input { width: auto; padding: 8px 10px; font-size: 13px; }
.inline-form button, .inline-form .btn { width: auto; margin-top: 0; padding: 8px 12px; font-size: 13px; }
