@import url('/fonts/fonts.css');

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5c6672;
  --border: #dde1e6;
  --primary: #1f4e79;
  --primary-hover: #173d60;
  --danger: #b42318;
  --focus: #2f80ed;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --topbar-h: 56px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { min-height: 100vh; font-size: 15px; line-height: 1.45; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .82rem; margin: .25rem 0 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: .5rem; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 38px; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; font-weight: 500;
  white-space: nowrap;
}
.btn:hover { background: #f7f8fa; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fef3f2; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-small { min-height: 32px; padding: .3rem .65rem; font-size: .88rem; }
.btn-block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; padding: 0;
}
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger { color: var(--danger); }

/* ---------- top bar */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .95rem; flex: none; }
.topbar-user { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32vw; font-size: .9rem; }

/* ---------- auth */
.auth-page { display: flex; flex-direction: column; align-items: center; padding: 3rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: .35rem; margin-top: 1.25rem; }
.auth-form label { font-weight: 600; font-size: .9rem; margin-top: .6rem; }
.auth-form input { padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 8px; }
.auth-form button { margin-top: 1rem; }
.auth-switch { margin-top: 1.25rem; text-align: center; }
.auth-privacy { font-size: .85rem; margin-top: 1rem; text-align: center; max-width: 420px; }
.form-error { color: var(--danger); margin: .5rem 0 0; }

/* ---------- dashboard */
.dashboard { max-width: 1120px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.dash-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.example-group { display: flex; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.example-select { min-height: 38px; border: 1px solid var(--border); border-radius: 8px; padding: 0 .5rem; background: var(--surface); max-width: 100%; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.doc-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.doc-open { padding: 1.1rem 1.1rem .6rem; color: inherit; text-decoration: none; flex: 1; min-width: 0; }
.doc-open h2 { overflow-wrap: anywhere; }
.doc-open:hover h2 { color: var(--primary); }
.doc-name { margin: .3rem 0; font-weight: 500; overflow-wrap: anywhere; }
.doc-meta { margin: .1rem 0; font-size: .85rem; overflow-wrap: anywhere; }
.doc-actions { display: flex; gap: .4rem; padding: .6rem 1.1rem 1rem; flex-wrap: wrap; }
.empty-state { grid-column: 1 / -1; background: var(--surface); border-radius: var(--radius); padding: 2.5rem; text-align: center; box-shadow: var(--shadow); }

/* ---------- editor layout */
.editor-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .55rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: var(--topbar-h); z-index: 15;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: .5rem; min-width: 0; flex-wrap: wrap; }
.tb-left { flex: 1 1 320px; flex-wrap: nowrap; }
.title-input { flex: 1 1 auto; min-width: 0; max-width: 420px; font-weight: 600; font-size: 1rem; border: 1px solid transparent; border-radius: 6px; padding: .35rem .5rem; background: transparent; }
.title-input:hover, .title-input:focus { border-color: var(--border); background: #fff; }
.save-status { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.save-status.is-dirty { color: #a15c07; }
.save-status.is-error { color: var(--danger); font-weight: 600; }
.save-status.is-saved::before { content: '✓ '; color: #18794e; }
.tb-label { font-size: .85rem; }

.editor-layout { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.15fr); }
@media (min-width: 900px) {
  body.is-editor #app { display: flex; flex-direction: column; height: 100vh; }
  body.is-editor .editor-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.is-editor .editor-toolbar { position: static; }
  body.is-editor .editor-layout { flex: 1; min-height: 0; }
  body.is-editor .form-pane, body.is-editor .preview-pane { min-height: 0; }
}
.form-pane { overflow-y: auto; padding: 1rem 1rem 4rem; border-right: 1px solid var(--border); min-width: 0; }
.preview-pane { overflow-y: auto; padding: 1rem 1.25rem 3rem; background: #e6e8ec; min-width: 0; }
.preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.preview-note { font-size: .78rem; }
.jump-preview { display: none; }

/* segmented control */
.seg { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: .3rem .7rem; border-radius: 6px; cursor: pointer; font-size: .88rem; }
.seg button.active { background: var(--primary); color: #fff; }

/* preview */
.preview-viewport { position: relative; overflow: hidden; width: 100%; }
.preview-scaler { transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.preview-frame { border: 0; display: block; background: transparent; box-shadow: none; }
.page-markers { position: absolute; inset: 0; pointer-events: none; }
.page-marker { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(31, 78, 121, .45); }
.page-marker span { position: absolute; right: 6px; top: 2px; font-size: 11px; background: rgba(31, 78, 121, .85); color: #fff; padding: 1px 6px; border-radius: 4px; }

/* panels & fields */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .6rem; }
.panel > summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; list-style: none; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.panel[open] > summary::before { transform: rotate(90deg); }
.panel-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge { background: #eef2f6; color: var(--muted); font-size: .75rem; border-radius: 10px; padding: 0 .5rem; font-weight: 600; }
.panel-body { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; flex: 1 1 0; }
.field > label { font-size: .82rem; font-weight: 600; color: #39434f; }
.field input:not([type=checkbox]):not([type=range]):not([type=color]), .field select, .field textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 7px; background: #fff; min-width: 0;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field-check { flex-direction: row; align-items: center; gap: .5rem; }
.field-check input { width: 18px; height: 18px; flex: none; }
.field-check label { font-weight: 500; font-size: .9rem; color: var(--text); }
.field-color input { width: 64px; height: 38px; border: 1px solid var(--border); border-radius: 7px; padding: 2px; background: #fff; }
.field-row { display: flex; gap: .7rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 140px; }
.field-stack { display: flex; flex-direction: column; gap: .4rem; flex: 2 1 200px; justify-content: center; }
.subfields { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .8rem .8rem; display: flex; flex-direction: column; gap: .6rem; margin: 0; min-width: 0; }
.subfields legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0 .3rem; }
.subfields.is-muted { opacity: .7; }

.item-list { display: flex; flex-direction: column; gap: .6rem; }
.item-card { border: 1px solid var(--border); border-radius: 8px; padding: .7rem; display: flex; flex-direction: column; gap: .6rem; background: #fbfcfd; min-width: 0; }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.item-controls { display: flex; gap: .3rem; flex: none; }
.btn-add { align-self: flex-start; }
.btn-add-section { width: 100%; margin-bottom: .6rem; border-style: dashed; }
.custom-head { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.order-list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 7px; }
.order-list li.is-hidden .order-name { color: var(--muted); text-decoration: line-through; }
.order-name { min-width: 0; overflow-wrap: anywhere; }

.photo-block { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.photo-thumb { width: 96px; height: 123px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: #eef1f4; flex: none; display: grid; place-items: center; font-size: .75rem; color: var(--muted); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-side { flex: 1 1 200px; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.photo-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.field-range input { width: 100%; }

/* toasts */
.toasts { position: fixed; bottom: 1rem; right: 1rem; left: 1rem; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; z-index: 50; pointer-events: none; }
.toast { background: #1c2430; color: #fff; padding: .6rem .9rem; border-radius: 8px; box-shadow: var(--shadow); max-width: min(420px, 100%); pointer-events: auto; }
.toast-error { background: var(--danger); }

/* ---------- responsive */
@media (max-width: 1100px) {
  .tb-label { display: none; }
}
@media (max-width: 899px) {
  .editor-layout { display: block; height: auto; }
  .form-pane { overflow: visible; border-right: 0; padding: .75rem .75rem 1.5rem; }
  .preview-pane { overflow: visible; padding: 1rem .75rem 4rem; }
  .jump-preview { display: inline-flex; position: fixed; right: 1rem; bottom: 1rem; z-index: 30; box-shadow: var(--shadow); }
  .editor-toolbar { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .topbar { padding: 0 .75rem; }
  .brand span:last-child { display: none; }
  .user-email { max-width: 45vw; }
  .auth-card { padding: 1.4rem; }
  .dashboard { padding: 1.25rem .75rem 3rem; }
  .dash-actions, .example-group { width: 100%; }
  .dash-actions > .btn, .example-group > * { flex: 1 1 auto; }
  .tb-right { width: 100%; }
  .tb-right .btn { flex: 1 1 auto; }
  .editor-toolbar { padding: .5rem .75rem; }
}

/* =====================================================================
   T002: navigation, workspace pages, tables, dialogs, admin panel
   ===================================================================== */
[hidden] { display: none !important; }
:root { --ok: #18794e; --warn: #a15c07; }
.topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; row-gap: 0; }
.main-nav { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.main-nav ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.main-nav a { display: block; padding: .45rem .7rem; border-radius: 7px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.main-nav a:hover { background: #f1f3f6; }
.main-nav a.active { background: #e8eef5; color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.main-nav a.nav-admin { color: #6b2a8a; }

.page { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.page > .dash-head { margin-bottom: .2rem; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem 1.1rem; min-width: 0; display: flex; flex-direction: column; gap: .7rem; }
.card h2, .section h2 { font-size: 1.02rem; }
.card h3 { font-size: .95rem; margin: .4rem 0 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.section { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.doc-open h3 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.empty-state h3 { margin: 0 0 .3rem; }
.notice { background: #fff8e6; border: 1px solid #f1d48a; color: #5c4400; border-radius: 8px; padding: .6rem .8rem; margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 6px; padding: .05rem .45rem; background: #efe7f6; color: #5a2377; }
.tag-on { background: #e5f4ec; color: var(--ok); }
.tag-off { background: #f3f4f6; color: var(--muted); }
code.id { font-size: .8rem; background: #f3f4f6; padding: .05rem .3rem; border-radius: 4px; }
.back-link { align-self: flex-start; }
.plain-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }

/* status badges: symbol + text, colour is only an extra cue */
.status { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 600; border-radius: 999px; padding: .1rem .55rem; border: 1px solid transparent; white-space: nowrap; }
.status-sym { font-size: .8em; }
.status-draft { background: #f1f3f5; color: #44505c; border-color: #dfe3e8; }
.status-ready { background: #e7f1fb; color: #1d4f80; border-color: #c4dbf2; }
.status-sent { background: #ecebfb; color: #3f37a1; border-color: #d2cff4; }
.status-interview { background: #fff4e0; color: #7a4a00; border-color: #f3d9a4; }
.status-offer { background: #e3f5ea; color: #155f3c; border-color: #b9e3c9; }
.status-rejected { background: #fdeceb; color: #9a2318; border-color: #f5c7c2; }
.status-withdrawn { background: #f4f0ea; color: #5f5446; border-color: #e3dacd; }
.acct-active, .result-ok { background: #e3f5ea; color: #155f3c; }
.acct-blocked, .result-error { background: #fdeceb; color: #9a2318; }
.acct-deactivated, .result-rejected { background: #f1f3f5; color: #44505c; }
.level { font-size: .82rem; font-weight: 600; }
.level-error { color: var(--danger); }
.level-warn { color: var(--warn); }

.status-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.status-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 9px; color: inherit; text-decoration: none; background: #fbfcfd; }
.status-tile:hover { border-color: var(--primary); }
.status-tile-n { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .2rem .5rem .2rem .25rem; cursor: pointer; }
.chip.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.chip-n { font-weight: 700; font-size: .85rem; min-width: 1.2em; text-align: center; }

/* toolbars and inline fields */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; }
.field-inline { flex: 0 1 220px; }
.toolbar .field-inline:first-child { flex: 1 1 260px; }
.field-inline input, .field-inline select { width: 100%; min-height: 38px; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.field-inline > label { font-size: .82rem; font-weight: 600; color: #39434f; }
.field-narrow { flex: 0 1 130px; }

/* tables */
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.table-wrap:focus-visible { outline: 2px solid var(--focus); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid #eceef1; vertical-align: middle; }
.data-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8f9fb; white-space: nowrap; }
.data-table tbody th { font-weight: 500; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfc; }
.empty-cell { color: var(--muted); text-align: center !important; padding: 1.2rem !important; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.sort-ind { color: #9aa3ad; }
.cell-main { display: flex; flex-direction: column; text-decoration: none; color: inherit; min-width: 0; }
.cell-title { font-weight: 600; color: var(--primary); overflow-wrap: anywhere; }
.cell-sub { font-size: .82rem; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.col-actions { width: 1%; white-space: nowrap; }
.status-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
.status-select { font-size: .82rem; padding: .15rem .3rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; max-width: 140px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.pager-btns { display: flex; align-items: center; gap: .5rem; }
.pager-pos { font-size: .88rem; }

/* dialogs */
.dialog { border: 0; border-radius: 12px; padding: 0; width: min(480px, calc(100vw - 2rem)); box-shadow: 0 20px 50px rgba(16, 24, 40, .3); }
.dialog::backdrop { background: rgba(16, 24, 40, .45); }
.dialog-body { padding: 1.3rem 1.4rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.dialog-body h2 { font-size: 1.1rem; overflow-wrap: anywhere; }
.dialog-body p { margin: 0; }
.dialog-list { margin: 0; padding-left: 1.2rem; max-height: 9rem; overflow: auto; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #912018; }

/* Bewerbung detail */
.panel-static { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem 1rem; margin-bottom: .7rem; display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.panel-static h2 { font-size: 1rem; }
.status-edit { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.status-edit select { flex: 1 1 140px; }
.doc-links { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .35rem; }
.export-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.readiness { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .8rem; }
.readiness-title { font-size: .92rem; margin: 0 0 .35rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.checklist .ok { color: var(--ok); }
.checklist .todo { color: #4b5560; }
.danger-zone h2 { color: #4b5560; }
.preview-title { font-size: .95rem; }

/* admin */
body.is-admin .topbar { background: #fbf8fd; }
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.admin-nav { border-right: 1px solid var(--border); background: var(--surface); padding: 1rem .6rem; }
.admin-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; position: sticky; top: calc(var(--topbar-h) + 1rem); }
.admin-nav a { display: block; padding: .5rem .7rem; border-radius: 7px; color: var(--text); text-decoration: none; font-weight: 500; }
.admin-nav a:hover { background: #f4f1f7; }
.admin-nav a.active { background: #efe7f6; color: #5a2377; font-weight: 600; }
.admin-main { padding: 1.5rem 1.5rem 4rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; max-width: 1300px; }
.admin-main:focus { outline: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .85rem 1rem; min-width: 0; }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.stat-label { font-weight: 600; font-size: .88rem; margin-top: .2rem; }
.stat-hint { font-size: .8rem; margin-top: .15rem; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.bars li { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; align-items: center; gap: .6rem; font-size: .88rem; }
.bar-label { overflow-wrap: anywhere; }
.bar-track { height: 10px; background: #eef1f4; border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.bar-value { font-weight: 600; min-width: 2.5em; text-align: right; }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: .35rem 1rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tpl-list { display: flex; flex-direction: column; gap: .8rem; }
.tpl-row { border: 1px solid var(--border); border-radius: 9px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .6rem; }
.tpl-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.tpl-head h3 { margin: 0; font-size: .98rem; }
.tpl-fields { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; }
.tpl-fields > .field:first-child { flex: 1 1 220px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.feature-list li { display: flex; align-items: center; gap: .55rem; }
.feature-list input { width: 18px; height: 18px; }

@media (max-width: 1100px) {
  .main-nav { order: 3; flex-basis: 100%; justify-content: flex-start; padding-bottom: .35rem; }
  .topbar { padding-top: .35rem; }
}
@media (max-width: 899px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { border-right: 0; border-bottom: 1px solid var(--border); padding: .4rem .6rem; }
  .admin-nav ul { flex-direction: row; overflow-x: auto; position: static; scrollbar-width: thin; }
  .admin-nav a { white-space: nowrap; padding: .4rem .6rem; }
  .admin-main { padding: 1rem .9rem 3rem; }
}
@media (max-width: 700px) {
  /* Tables become stacked cards: no horizontal scrolling on phones. */
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table, .data-table tbody, .data-table tr, .data-table th, .data-table td { display: block; width: 100%; }
  .data-table tbody tr { border-bottom: 1px solid #e3e6ea; padding: .5rem .2rem; }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table tbody th, .data-table td { border: 0; padding: .2rem .6rem; }
  .data-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); font-size: .8rem; }
  .data-table td.col-actions { width: 100%; white-space: normal; padding-top: .4rem; }
  .data-table td.col-actions::before { display: none; }
  .table-wrap { overflow-x: visible; }
  .status-cell { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .page { padding: 1.1rem .75rem 3rem; }
  .field-inline, .toolbar .field-inline:first-child { flex: 1 1 100%; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .kv dd { margin-bottom: .4rem; }
  .bars li { grid-template-columns: minmax(80px, 40%) minmax(0, 1fr) auto; }
}
@media (max-width: 560px) {
  .brand .brand-name { display: none; }
  .export-actions { width: 100%; }
  .export-actions .btn { flex: 1 1 auto; }
}
.stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.admin-main > .dash-head, .page > .dash-head { margin-bottom: 0; }
@media (max-width: 560px) {
  .main-nav ul, .admin-nav ul { flex-wrap: wrap; overflow-x: visible; }
  .main-nav a, .admin-nav a { padding: .35rem .55rem; }
}
.card > .btn { align-self: flex-start; }

/* ---------- T003: document library and Bewerbungsmappe builder */
.upload-form { display: flex; flex-direction: column; gap: .6rem; }
.upload-form input[type=file] { max-width: 100%; padding: .35rem 0; }
.upload-form.is-compact { margin-top: .5rem; }
.doc-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.doc-file { font-size: .78rem; }
.col-name { min-width: 12rem; }
.pkg { display: flex; flex-direction: column; gap: .7rem; }
.pkg-summary { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .45rem; }
.pkg-state { margin: 0; font-weight: 600; }
.pkg-state.is-ready { color: var(--ok, #1a7f37); }
.pkg-state.is-incomplete { color: #8a5a00; }
.pkg-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; }
.pkg-issues .is-error { color: var(--danger); }
.pkg-issues .is-warning { color: #5c4400; }
.pkg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.pkg-item {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: .3rem .6rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: .5rem .6rem;
}
.pkg-item.is-excluded { background: #f6f7f9; }
.pkg-item.is-excluded .pkg-name { color: var(--muted); }
.pkg-item.is-broken { border-color: var(--danger); }
.pkg-item.is-dragging { opacity: .5; }
.pkg-item.is-drop { outline: 2px dashed var(--focus); outline-offset: 2px; }
.pkg-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; user-select: none; }
.pkg-pos { min-width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #e8eef5; color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }
.pkg-body { display: flex; flex-direction: column; min-width: 0; }
.pkg-name { font-weight: 600; overflow-wrap: anywhere; word-break: break-word; }
.pkg-meta { font-size: .8rem; overflow-wrap: anywhere; }
.pkg-tag { margin-left: .4rem; font-size: .72rem; font-weight: 500; border: 1px solid var(--border); border-radius: 999px; padding: 0 .4rem; color: var(--muted); }
.pkg-actions { grid-column: 3 / -1; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.pkg-include { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; margin-right: .2rem; min-height: 38px; }
.pkg-actions .btn-small { min-width: 38px; }
.pkg-add { display: flex; flex-direction: column; gap: .4rem; }
.inline-add { display: flex; gap: .4rem; flex-wrap: wrap; }
.inline-add select { flex: 1 1 12rem; min-width: 0; max-width: 100%; }
.pkg-upload > summary { cursor: pointer; color: var(--primary); font-size: .9rem; min-height: 32px; display: flex; align-items: center; }
@media (max-width: 700px) {
  .pkg-item { grid-template-columns: auto minmax(0, 1fr); }
  .pkg-handle { display: none; }
  .pkg-actions { grid-column: 1 / -1; }
}

/* Career studio: warm paper, oxblood ink and a locally served editorial face. */
:root {
  --bg: #f7f4ed; --surface: #fffdf8; --text: #302825; --muted: #685e58;
  --border: #dcd5c9; --primary: #742c40; --primary-hover: #552033;
  --focus: #864056; --radius: 5px; --shadow: 0 1px 4px #43312312;
  --serif: 'Noto Serif', Georgia, serif;
}
h1, .brand-name, .card-head h2, .card > h2, .auth-card h1, .panel-static h2, .doc-open h3 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.035em;
}
h1 { font-size: clamp(1.9rem,3vw,3rem); line-height: 1.16; }
.topbar { background: var(--surface); border-bottom-color: #ccc1af; }
.brand-mark { font: italic 1.5rem Georgia,serif; border-radius: 2px; }
.brand-name { font-size: 1.14rem; }
.btn { border-radius: 4px; }
.main-nav a.active, .admin-nav a.active { color: var(--primary); background: #f3e8e7; }
.auth-page { padding-block: clamp(3rem,9vh,7rem); }
.auth-card, .card, .doc-card, .stat { border: 1px solid var(--border); }
.auth-card { border-top: 4px solid var(--primary); padding: clamp(1.3rem,4vw,2.4rem); }
.dash-head { padding-bottom: 1.5rem; border-bottom: 1px solid #bfb3a4; }
.status-tile { background: #faf7f1; border-radius: 3px; }
.status-tile-n, .stat-value { font: 400 2rem var(--serif); font-variant-numeric: tabular-nums; }
.status-rejected { background: #efe9e5; color: #644e48; border-color: #d6c8c1; }
.preview-pane { background: #ddd7ce; }
.preview-viewport { box-shadow: 0 4px 16px #3a30242b; }
.form-pane { background: #f8f5ef; }
.panel[open] > summary { color: var(--primary); border-bottom: 1px solid var(--border); margin-bottom: .85rem; }
.editor-toolbar { background: #fffcf7; }
.upload-form:not(.is-compact) { border: 1px dashed #ad9488; background: #f8f3eb; padding: 1.2rem; }
.pkg-summary { border-left: 3px solid var(--primary); padding-left: .8rem; }
.pkg-pos { font-family: var(--serif); color: var(--primary); }
.pkg-item:not(.is-excluded) { background: var(--surface); }
.recent-files { overflow-wrap: anywhere; }
.recent-files p { padding: .55rem 0; margin: 0; border-bottom: 1px solid var(--border); }
.template-choices { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .45rem; }
.template-choices legend { font-size: .85rem; margin-bottom: .35rem; }
.template-choices label { display: grid; position: relative; justify-items: center; gap: .4rem; padding: .7rem .3rem; text-align: center; font-size: .8rem; border: 1px solid var(--border); border-radius: 3px; cursor: pointer; }
.template-choices input { position: absolute; top: .2rem; left: .2rem; accent-color: var(--primary); }
.template-choices label:has(:checked) { background: #f4e9e8; border-color: var(--primary); }
.mini-page { display: block; width: 42px; height: 54px; padding: 6px; background: #fff; box-shadow: 0 1px 4px #37282138; }
.mini-page::before { content: ''; display: block; height: 8px; width: 70%; border-bottom: 2px solid #745a50; }
.mini-page::after { content: ''; display: block; height: 58%; margin-top: 4px; background: repeating-linear-gradient(#bdb2a7 0 1px,transparent 1px 5px); }
.mini-page.modern { border-left: 5px solid #d8c3aa; }
.mini-page.compact::after { background-size: 100% 3px; }
.cv-thumbnail { display: grid; place-items: center; padding: .8rem; margin: -1.1rem -1.1rem .8rem; background: #e8e1d5; }
body.is-admin .topbar, .data-table thead th { background: #f3eee6; }
.landing { max-width: 1280px; margin: auto; padding: 0 clamp(1rem,4vw,4rem); }
.hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(1.5rem,5vw,5rem); padding: clamp(2rem,5vw,4.8rem) 0; }
.kicker, .folio-label, .hero-note { font-size: .76rem; letter-spacing: .1em; }
.kicker, .folio-label { text-transform: uppercase; font-weight: 700; }
.kicker { color: var(--primary); margin: 0 0 1.6rem; }
.hero h1 { font-size: clamp(3rem,5.7vw,5.6rem); line-height: 1.04; letter-spacing: -.07em; }
.hero h1 em { color: var(--primary); font-weight: 400; }
.lead { max-width: 35ch; color: var(--muted); font-size: clamp(1rem,1.5vw,1.22rem); margin: 1.4rem 0; }
.hero .btn { padding: .75rem 1.2rem; }
.hero-note { color: var(--muted); letter-spacing: .02em; }
.folio-stage { min-width: 0; padding: clamp(1.25rem,3vw,3rem); background: #714050; border-radius: 3px; }
.folio { margin: 0; background: #fffdf8; box-shadow: 7px 7px 0 #cfb89d, 0 10px 24px #32151f38; }
.folio-label, .folio figcaption { padding: .65rem 1rem; }
.folio-label { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); color: var(--primary); }
.folio-crop { height: clamp(230px,27vw,370px); overflow: hidden; }
.folio figcaption { border-top: 1px solid var(--border); font: italic .85rem Georgia,serif; color: var(--muted); }
.template-band, .landing footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 0; border-block: 1px solid var(--border); }
.landing h2 { font: 400 1.4rem var(--serif); letter-spacing: -.04em; }
.template-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.template-tabs button { border: 1px solid var(--border); border-radius: 3px; background: var(--surface); cursor: pointer; padding: .55rem .8rem; font-size: .85rem; }
.template-tabs [aria-pressed=true] { background: var(--primary); color: white; }
.workflow { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; padding: 2.5rem 0; }
.workflow p { color: var(--muted); max-width: 34ch; }
.landing footer { font-size: .85rem; }
@media (max-width: 700px) {
  .hero, .workflow { grid-template-columns: 1fr; }
  .workflow { gap: .75rem; }
  .hero h1 { font-size: clamp(3rem,12vw,4rem); }
  .template-tabs button, .pkg-actions button { min-height: 40px; }
}

.section-jump { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .85rem; }
.section-jump label, .pkg-order-title { font: 400 1.25rem var(--serif); margin: 0; }
.section-jump select { background: var(--surface); padding: .45rem; border: 1px solid var(--border); border-radius: 3px; max-width: 100%; }
.panel { scroll-margin-top: 7rem; }
@media (min-width: 900px) { .panel { scroll-margin-top: 1rem; } }
