:root {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-inner: #f8fafc;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --header-bg: #ffffff;
  --input-bg: #f8fafc;
}
.dark {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-inner: #0f172a;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --header-bg: #1e293b;
  --input-bg: #0f172a;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; transition: background-color 0.2s; }

header { background: var(--header-bg); border-bottom: 1px solid var(--border-color); padding: 1rem; }
.header-content { max-width: 1600px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon { width: 40px; height: 40px; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.brand h1 { font-size: 1.25rem; color: #ea580c; font-weight: bold; }

.btn-group { display: flex; gap: 0.5rem; align-items: center; }
.btn { padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border-color); background: var(--bg-main); color: var(--text-main); display: inline-flex; align-items: center; gap: 0.3rem; }
.btn-orange { background: #ea580c; color: white; border: none; }
.btn-orange:hover { background: #c2410c; }
.btn-emerald { background: #059669; color: white; border: none; width: 100%; justify-content: center; padding: 0.5rem; }
.btn-emerald:hover { background: #047857; }

main { max-width: 1600px; width: 100%; margin: 0 auto; padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 1.5rem; }

.section-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.25rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.75rem; }
.section-title { font-weight: bold; display: flex; align-items: center; gap: 0.5rem; }
.title-open { color: #ea580c; }
.title-done { color: #059669; }

.badge { font-size: 0.75rem; padding: 0.1rem 0.6rem; border-radius: 9999px; font-weight: 600; }
.badge-open { background: rgba(234, 88, 12, 0.15); color: #ea580c; border: 1px solid rgba(234, 88, 12, 0.3); }
.badge-done { background: rgba(5, 150, 105, 0.15); color: #059669; border: 1px solid rgba(5, 150, 105, 0.3); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card { background: var(--bg-inner); border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; justify-content: space-between; gap: 0.75rem; }

.urgency-badge { font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 4px; color: white; font-weight: bold; }
.urgency-Dringend { background: #e11d48; }
.urgency-Hoch { background: #d97706; }
.urgency-Normal { background: #2563eb; }
.urgency-Niedrig { background: #64748b; }

.img-list { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.25rem 0; }
.img-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); cursor: pointer; }

.subtasks { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; }
.subtask-item { display: flex; align-items: center; gap: 0.5rem; }
.line-through { text-decoration: line-through; color: var(--text-muted); }

.progress-container { margin-top: 0.4rem; margin-bottom: 0.2rem; }
.progress-text { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.2rem; }
.progress-bar-bg { width: 100%; height: 6px; background: var(--border-color); border-radius: 9999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: #ea580c; transition: width 0.3s ease; border-radius: 9999px; }

details summary { cursor: pointer; list-style: none; user-select: none; }
details summary::-webkit-details-marker { display: none; }

.item-done { background: var(--bg-inner); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.item-done-summary { padding: 0.75rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.item-done-details { padding: 0.75rem; border-top: 1px solid var(--border-color); background: var(--bg-main); display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.8rem; }

select, input[type="text"] { width: 100%; background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-main); padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.8rem; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; width: 100%; max-width: 500px; padding: 1.5rem; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.hidden { display: none !important; }

svg { display: inline-block; vertical-align: middle; }

