:root { --bg:#f3f4f6; --card:#fff; --text:#111827; --muted:#6b7280; --line:#e5e7eb; --primary:#1f4e79; --primary-h:#173c5e; --danger:#b91c1c; --radius:10px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: 0 0 .8rem; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
code { background: #eef; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.pre { white-space: pre-wrap; font: .85rem/1.4 ui-monospace, Menlo, Consolas, monospace; background: #f9fafb; padding: 12px; border-radius: 6px; max-height: 60vh; overflow: auto; }

.topnav { background: #111827; display: flex; align-items: center; gap: 4px; padding: 0 16px; flex-wrap: wrap; }
.topnav a { color: #d1d5db; text-decoration: none; padding: 14px 12px; font-weight: 500; }
.topnav a:hover, .topnav a.active { color: #fff; box-shadow: inset 0 -3px 0 #60a5fa; }
.topnav .brand { font-weight: 700; color: #fff; font-size: 1.05rem; margin-right: 8px; }
.topnav .right { margin-left: auto; }

.container { max-width: 1400px; margin: 0 auto; padding: 24px 16px 60px; }
.container.narrow { max-width: 440px; padding-top: 10vh; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.narrow-card { max-width: 560px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.cv-card { display: flex; gap: 16px; margin: 0; }
.thumb { width: 70px; height: 88px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); background: #f9fafb; text-align: center; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.h1-input { font: inherit; font-weight: 700; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; min-width: 320px; }
.h1-input:hover, .h1-input:focus { border-color: var(--line); background: #fff; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.actions.right { justify-content: flex-end; }
.actions form { margin: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { margin: 0; }

label { display: block; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: 10px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
input, select, textarea { display: block; width: 100%; font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; margin-top: 4px; background: #fff; color: var(--text); }
input[type=color] { padding: 2px; height: 38px; width: 60px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: #60a5fa; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 0; margin: 0 0 12px; }
legend { font-size: .8rem; color: var(--muted); padding: 0 6px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > label { flex: 1 1 140px; }
.row > label.grow2 { flex: 2 1 220px; }

.btn { display: inline-block; font: inherit; font-size: .9rem; font-weight: 600; padding: 8px 14px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: #f3f4f6; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-h); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.btn.icon { padding: 4px 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.steps { padding-left: 20px; margin: 0 0 8px; }
.steps li { margin-bottom: 4px; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e5e7eb; color: #374151; }
.st-entwurf { background: #e5e7eb; } .st-versendet { background: #dbeafe; color: #1e40af; } .st-einladung { background: #fef3c7; color: #92400e; }
.st-absage { background: #fee2e2; color: #991b1b; } .st-zusage { background: #d1fae5; color: #065f46; } .st-zurueckgezogen { background: #f3f4f6; color: #6b7280; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--text); }
.stat b { display: block; font-size: 1.7rem; color: var(--primary); }
.stat span { font-size: .85rem; color: var(--muted); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; font-size: .85rem; font-weight: 600; color: #374151; background: #e5e7eb; }
.tabs a.active { background: var(--primary); color: #fff; }

.login-card h1 { text-align: center; margin-bottom: 4px; } .login-card .muted { text-align: center; }
.login-card .btn { width: 100%; margin-top: 4px; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.editor-preview { position: sticky; top: 16px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
#preview { width: 100%; height: calc(100vh - 80px); border: 1px solid var(--line); border-radius: var(--radius); background: #6b7280; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-head .actions { margin: 0; }
.handle { color: #9ca3af; cursor: default; }
.sec-title { margin: 0; font-weight: 700; flex: 1; }
.entry { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 4px; margin-bottom: 10px; background: #fafafa; }
.entry label { margin-bottom: 8px; }
.skill { align-items: flex-end; } .skill .btn { margin-bottom: 10px; }
.photo-box { display: flex; gap: 16px; align-items: flex-start; }
.photo-preview { width: 96px; height: 120px; border: 1px dashed #d1d5db; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f9fafb; flex-shrink: 0; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-box .btn { margin-right: 6px; }

.dropzone { position: relative; border: 2px dashed #93c5fd; border-radius: 10px; padding: 22px; text-align: center; background: #eff6ff; margin-bottom: 14px; }
.dropzone.over { background: #dbeafe; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; }
.dropzone p { margin: 0; }
details.card summary { cursor: pointer; }

@media (max-width: 1000px) {
  .grid2, .editor { grid-template-columns: 1fr; }
  .editor-preview { position: static; }
  #preview { height: 80vh; }
  .h1-input { min-width: 0; width: 100%; }
}

/* ===== v2 additions ===== */
.center { text-align: center; }
.ok-text { color: #065f46; } .warn-text { color: #92400e; }
.js-neu { background: #e5e7eb; } .js-interessant { background: #fef3c7; color: #92400e; } .js-beworben { background: #dbeafe; color: #1e40af; } .js-verworfen { background: #f3f4f6; color: #9ca3af; }
.st-fertig { background: #ede9fe; color: #5b21b6; }
.score { display: inline-block; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: .85rem; background: #e5e7eb; }
.score.s0 { background: #fee2e2; color: #991b1b; } .score.s1 { background: #fef3c7; color: #92400e; } .score.s2 { background: #dbeafe; color: #1e40af; } .score.s3, .score.s4 { background: #d1fae5; color: #065f46; }
ul.tight { margin: 4px 0 10px; padding-left: 20px; } ul.tight li { margin-bottom: 2px; }
.ok-list li::marker { color: #059669; } .warn-list li::marker { color: #d97706; }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.hits { display: flex; flex-direction: column; gap: 8px; }
.hit { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.hit-main { flex: 1 1 320px; } .hit-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .hit-actions form { display: flex; gap: 6px; margin: 0; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.src { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tpl-card { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tpl-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,78,121,.15); }
.tpl-frame { height: 380px; overflow: hidden; background: #6b7280; position: relative; }
.tpl-frame iframe { width: 830px; height: 1180px; border: 0; transform: scale(.36); transform-origin: 0 0; position: absolute; left: 50%; margin-left: -150px; top: 8px; pointer-events: none; background: #fff; }
.tpl-info { padding: 12px 14px; } .tpl-info p { margin: 4px 0 8px; }
.swatches { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d1d5db; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--primary); }
.swatches input[type=color] { width: 40px; height: 30px; margin: 0; }
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; }
.col { background: #e9ebef; border-radius: 10px; padding: 10px; min-height: 200px; }
.col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kcard { display: block; background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 8px; text-decoration: none; color: var(--text); border: 1px solid var(--line); }
.kcard:hover { border-color: var(--primary); }
.timeline { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; max-height: 260px; overflow: auto; }
.tl { font-size: .85rem; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.tl-date { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.tl-type { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: #e5e7eb; margin-right: 6px; }
.tl-status { background: #dbeafe; color: #1e40af; } .tl-ki { background: #ede9fe; color: #5b21b6; } .tl-pdf { background: #d1fae5; color: #065f46; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
.inline-details { display: inline-block; } .inline-details summary { list-style: none; display: inline-block; cursor: pointer; } .inline-details[open] summary { display: none; }
table.small td { padding: 4px 8px; }
@media (max-width: 1000px) { .import-grid { grid-template-columns: 1fr; } .board { grid-template-columns: repeat(6, 220px); } }

.src-ba { background: #dbeafe; color: #1e40af; } .src-arbeitnow { background: #fef3c7; color: #92400e; } .src-adzuna { background: #d1fae5; color: #065f46; }
