/* Druckdaten-Portal */
:root {
  --brand: #0b4f8a;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #17202b;
  --muted: #5e6b7a;
  --line: #dfe4ea;
  --soft: #f7f9fb;
  --green: #1d7a46;   --green-bg: #e7f5ec;
  --amber: #8a5a00;   --amber-bg: #fdf3dc;
  --red: #b42318;     --red-bg: #fdecea;
  --blue: #1f5fa8;    --blue-bg: #e8f0fb;
  --grey: #55606d;    --grey-bg: #eef1f4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 26px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1280px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* Kopf */
.topbar { background: var(--brand); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 10px; letter-spacing: .01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.75); }
.topbar-event { opacity: .85; font-size: 14px; }
.topbar a { color: #fff; }

/* Karten */
main.wrap, main { padding-top: 24px; padding-bottom: 48px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin: 0 0 16px;
}
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.hero h1 { margin: 4px 0 10px; word-break: break-word; }
.hero-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.lead { font-size: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.chip.strong { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.deadline { margin-top: 14px; font-size: 14px; color: var(--muted); }
#banner .notice { margin-top: 16px; margin-bottom: 0; }

/* Statusanzeigen */
.pill, .badge {
  display: inline-block; border-radius: 999px; font-weight: 600; white-space: nowrap;
}
.pill { padding: 6px 14px; font-size: 14px; }
.badge { padding: 2px 10px; font-size: 12px; }
.grey  { background: var(--grey-bg);  color: var(--grey); }
.amber { background: var(--amber-bg); color: var(--amber); }
.blue  { background: var(--blue-bg);  color: var(--blue); }
.red   { background: var(--red-bg);   color: var(--red); }
.green { background: var(--green-bg); color: var(--green); }
.notice { border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.notice > div + div { margin-top: 6px; }

/* Hinweise */
.guide summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; list-style: none; flex-wrap: wrap; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: "›"; display: inline-block; margin-right: 8px; transition: transform .15s; font-size: 18px; color: var(--muted); }
.guide[open] summary::before { transform: rotate(90deg); }
.guide summary > span:first-child { flex: 1; }
.guide-list { margin: 14px 0 0; padding-left: 20px; }
.guide-list li { margin: 6px 0; }

/* Optionen */
.options { display: grid; gap: 8px; margin-top: 12px; }
.option { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--soft); }
.option:hover { border-color: var(--brand); }
.option input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }

/* Positionen */
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item-info { margin: 8px 0 14px; color: var(--muted); font-size: 14px; }
.item-info b { color: var(--text); }
.item.inactive { background: var(--soft); box-shadow: none; padding: 14px 20px; }
.item.inactive h2 { color: var(--muted); font-size: 15px; }
.item.inactive p { margin: 4px 0 0; }

.file-list:empty { display: none; }
.file {
  display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.file.failed { border-color: #f3c2bd; background: var(--red-bg); }
.file.failed .status { color: var(--red); font-weight: 600; }
.thumb {
  width: 64px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; background: var(--grey-bg);
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb.ext { font-size: 12px; font-weight: 700; color: var(--grey); letter-spacing: .04em; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 13px; }
.check { font-size: 13px; margin-top: 3px; display: flex; gap: 7px; align-items: baseline; }
.check .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.check.ok   { color: var(--green); } .check.ok .dot   { background: var(--green); }
.check.info { color: var(--blue); }  .check.info .dot { background: var(--blue); }
.check.warn { color: var(--amber); font-weight: 600; } .check.warn .dot { background: #d18b00; }
.bar { height: 6px; background: var(--grey-bg); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

.dropzone {
  border: 2px dashed #b9c4d0; border-radius: 12px; padding: 22px 16px; text-align: center; cursor: pointer;
  background: var(--soft); transition: background .15s, border-color .15s; display: grid; gap: 4px; justify-items: center;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.over { border-color: var(--brand); background: #eef4fb; outline: none; }
.dz-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); position: relative; margin-bottom: 4px; }
.dz-icon::before { content: ""; position: absolute; left: 50%; top: 9px; width: 2px; height: 15px; background: #fff; transform: translateX(-50%); }
.dz-icon::after { content: ""; position: absolute; left: 50%; top: 9px; width: 9px; height: 9px; border-left: 2px solid #fff; border-top: 2px solid #fff; transform: translateX(-50%) rotate(45deg); }
.link { color: var(--brand); text-decoration: underline; }

/* Formulare & Buttons */
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; margin: 12px 0; }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), select, textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #c8d0da; border-radius: 8px; background: #fff; color: var(--text); width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.btn {
  font: inherit; font-weight: 600; border-radius: 8px; padding: 9px 16px; cursor: pointer; border: 1px solid var(--line);
  background: #fff; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn:hover { border-color: #aab5c2; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 12px 22px; font-size: 16px; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #f0b3ad; background: var(--red-bg); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.icon-btn { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.submit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.lookup { display: grid; gap: 12px; margin: 16px 0; }
.lookup label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.footer-note { text-align: center; margin-top: 24px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1d2733; color: #fff;
  padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .2s; max-width: calc(100% - 32px); z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ───────── Admin ───────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.kpi:hover { border-color: var(--brand); }
.kpi .n { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpi .meter { height: 4px; border-radius: 9px; margin-top: 10px; background: var(--grey-bg); overflow: hidden; }
.kpi .meter span { display: block; height: 100%; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; flex: 0 0 auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: 0; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { color: var(--muted); font-size: 12px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.row-actions .btn { white-space: nowrap; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar h1 { font-size: 22px; }
.toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; margin: 12px 0 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.log { font-size: 13px; max-height: 260px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.log li span:first-child { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-group + .item-group { margin-top: 18px; }
.item-group h3 { font-size: 14px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-size: 14px; }
.count-line { color: var(--muted); font-size: 13px; margin: 8px 2px; }

@media (max-width: 720px) {
  h1 { font-size: 22px; }
  .card { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 0 0; }
  .dl dt { margin-top: 8px; }
  .file { flex-wrap: wrap; }
  .file .btn { margin-left: 78px; }
  .hide-sm { display: none; }
}
