:root {
    --bg: #eae7df;
    --surface: #ffffff;
    --ink: #1e2124;
    --ink-soft: #55585e;
    --accent: #ffc530;
    --accent-ink: #1e2124;
    --line: #d8d4c8;
    --danger: #c1440e;
    --success: #2f6e4e;
    --muted: #8a8d92;
    --radius: 10px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    background-image: radial-gradient(circle at 1px 1px, rgba(30,33,36,0.06) 1px, transparent 0);
    background-size: 18px 18px;
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }
header.app-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.badge {
    width: 52px; height: 52px; background: var(--ink); color: var(--accent);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -1px;
    flex-shrink: 0; transform: rotate(-2deg);
}
.app-head h1 { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 24px; letter-spacing: 0.5px; text-transform: uppercase; margin: 0; }
.app-head .subtitle { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.app-head { position: relative; }
#head-right { margin-left: auto; text-align: right; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h2 { font-family: 'Oswald', sans-serif; font-size: 17px; text-transform: uppercase; letter-spacing: 0.3px; margin: 0 0 14px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 7px;
    font-family: 'Inter', sans-serif; font-size: 15px; background: #fdfdfb; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field textarea { min-height: 70px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
    background: var(--ink); color: var(--accent); border: none; padding: 12px 18px;
    border-radius: 8px; font-weight: 700; font-size: 14.5px; cursor: pointer;
    width: 100%; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { opacity: 0.92; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost { background: none; color: var(--ink-soft); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 8px 12px; font-size: 12.5px; }
.btn.danger-outline { background: none; color: var(--danger); border: 1.5px solid var(--danger); }

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

.sum-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.sum-strip .item { flex: 1 1 100px; background: #f7f6f2; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: center; }
.sum-strip .num { display: block; font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 19px; }
.sum-strip .lbl { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

.arbeit-block { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 6px; background: #fdfdfb; }
.arbeit-block .ab-info { display: flex; flex-direction: column; gap: 2px; }
.arbeit-block .ab-info span { color: var(--ink-soft); font-size: 12px; }

.search-row { padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 6px; background: #fdfdfb; cursor: pointer; }
.search-row:hover { background: #f2f1ec; }
.search-row .ab-info { display: flex; flex-direction: column; gap: 2px; }
.search-row .ab-info span { color: var(--ink-soft); font-size: 12px; }

.del-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 6px; flex-shrink: 0; line-height: 1; }
.del-btn:hover { color: var(--danger); }

.day-editor .de-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 10px; }
.de-actions { display: flex; gap: 10px; margin-top: 4px; }
.de-actions .btn { width: auto; flex: 1; }

.empty { color: var(--ink-soft); font-size: 13.5px; text-align: center; }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
    background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px;
    opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 80; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.scanner-overlay {
    position: fixed; inset: 0; background: rgba(20,22,24,0.92); z-index: 70;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.scanner-box { background: var(--surface); border-radius: 12px; padding: 16px; max-width: 420px; width: 100%; }
#reader { border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
