/* PUCH Service- & Technikportal – helles, ruhiges Design (Apple-inspiriert) */
:root {
  --bg: #f5f5f7; --card: #ffffff; --text: #1d1d1f; --muted: #6e6e73; --faint: #86868b;
  --line: rgba(0, 0, 0, .08); --line-strong: rgba(0, 0, 0, .14); --fill: rgba(0, 0, 0, .045);
  --accent: #12823b; --accent-d: #0e6a30; --accent-bg: rgba(18, 130, 59, .1);
  --navy: #1d1d1f; --navy-2: #2c2c2e;
  --blue: #0066cc; --blue-bg: #e8f1fc; --green: #1d7a46; --green-bg: #e6f5ec; --amber: #8a5a00; --amber-bg: #fff3d6;
  --red: #c4282d; --red-bg: #fdeaea; --grey-bg: #efeff2;
  --r: 12px; --r-lg: 20px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 24px rgba(0, 0, 0, .05);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .09);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; letter-spacing: -.011em; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 2rem; font-weight: 650; letter-spacing: -.025em; margin: 0 0 .3rem; line-height: 1.15; color: var(--text); }
h2 { font-size: 1.2rem; font-weight: 620; letter-spacing: -.02em; margin: 1.8rem 0 .8rem; color: var(--text); }
h3 { font-size: 1rem; font-weight: 600; margin: 1.1rem 0 .4rem; color: var(--text); }
h4 { margin: .8rem 0 .2rem; font-size: .95rem; }
.card h2:first-child { margin-top: 0; }
p { margin: 0 0 .8rem; }
code, .code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: .86em; background: var(--fill); padding: .12em .4em; border-radius: 6px; }
pre.code { padding: .9rem 1rem; overflow: auto; max-height: 340px; border-radius: var(--r); }
.muted { color: var(--muted); } .small { font-size: .86rem; } .right { text-align: right; } .num { text-align: right; font-variant-numeric: tabular-nums; } .nowrap { white-space: nowrap; }
.center { text-align: center; }
.req { color: var(--accent); }

/* ---------- Header (hell, Milchglas) ---------- */
.topbar { background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: .65rem 1.4rem; display: flex; align-items: center; gap: 1.4rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none !important; }
.brand-logo { display: block; width: 36px; height: 36px; }
.brand-sub { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.search { flex: 1; display: flex; max-width: 520px; margin-left: auto; position: relative; }
.search input { flex: 1; border: 0; background: var(--fill); border-radius: var(--r-pill); padding: .55rem 5.2rem .55rem 1.1rem; font-size: .9rem; min-width: 0; margin: 0; }
.search input:focus { background: #fff; box-shadow: 0 0 0 4px var(--accent-bg), inset 0 0 0 1px var(--accent); outline: 0; }
.search button { position: absolute; right: 4px; top: 4px; bottom: 4px; border: 0; background: var(--text); color: #fff; padding: 0 1rem; border-radius: var(--r-pill); font-weight: 600; font-size: .82rem; cursor: pointer; }
.search button:hover { background: #3a3a3c; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { background: linear-gradient(145deg, #f0f0f3, #dcdce1); color: var(--text); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; font-weight: 650; font-size: .78rem; box-shadow: inset 0 0 0 1px var(--line); }
.uname { display: flex; flex-direction: column; font-size: .86rem; line-height: 1.2; font-weight: 600; }
.uname small { color: var(--muted); font-size: .74rem; font-weight: 400; }
.usermenu .menu { position: absolute; right: 0; top: 135%; background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: var(--text); border-radius: 16px; box-shadow: var(--shadow-hover), 0 0 0 1px var(--line); min-width: 210px; padding: .4rem; z-index: 30; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: .55rem .8rem; border: 0; background: none; color: var(--text); font: inherit; border-radius: 10px; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--fill); text-decoration: none; }
.mainnav { border-top: 1px solid var(--line); background: transparent; }
.mainnav-in { max-width: 1280px; margin: 0 auto; padding: .35rem 1.4rem; display: flex; gap: .2rem; overflow-x: auto; }
.mainnav a { color: var(--muted); padding: .42rem .95rem; font-weight: 520; font-size: .92rem; white-space: nowrap; border-radius: var(--r-pill); transition: background .15s, color .15s; }
.mainnav a:hover { color: var(--text); text-decoration: none; background: var(--fill); }
.mainnav a.active { color: var(--text); background: var(--fill); font-weight: 620; }
.count { background: var(--accent); color: #fff; border-radius: var(--r-pill); padding: .02rem .5rem; font-size: .7rem; font-weight: 700; margin-left: .3rem; }

/* ---------- Layout ---------- */
.shell { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 2rem 1.4rem 2.5rem; }
.shell.with-side { display: grid; grid-template-columns: 232px 1fr; gap: 2rem; align-items: start; }
.side { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: .7rem; position: sticky; top: 84px; }
.side h4 { margin: 1rem .8rem .3rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 650; }
.side a { display: flex; justify-content: space-between; align-items: center; padding: .5rem .8rem; border-radius: 10px; color: var(--text); font-size: .92rem; transition: background .15s; }
.side a:hover { background: var(--fill); text-decoration: none; }
.side a.active { background: var(--accent-bg); color: var(--accent-d); font-weight: 620; }
.main { min-width: 0; }
.foot { text-align: center; color: var(--faint); font-size: .78rem; padding: 1.4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin-bottom: .1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.crumbs { color: var(--faint); font-size: .86rem; margin-bottom: .6rem; }
.narrow { max-width: 560px; margin: 3rem auto; }

/* ---------- Karten ---------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.35rem 1.5rem; margin-bottom: 1.2rem; }
.card.flush { padding: 0; overflow: hidden; overflow-x: auto; }
.card.flush .table { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .7rem; }
.card-head h2, .card-head h3 { margin: 0; }
.pad { padding: 1.1rem 1.5rem; }
.card.callout { box-shadow: var(--shadow), inset 4px 0 0 var(--accent); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem; align-items: start; }
.cols.two-one { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.1rem; }
.grid2.tight { gap: 0 .6rem; }
.stack { display: grid; gap: .7rem; }
.row-link { display: flex; flex-direction: column; gap: .2rem; color: var(--text); margin-bottom: 0; transition: box-shadow .2s, transform .2s; }
.row-link:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.empty { color: var(--faint); padding: .6rem 0; }
.card.empty { padding: 1.4rem; text-align: center; }

/* ---------- Kacheln ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.tile { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .4rem; color: var(--text); transition: box-shadow .2s, transform .2s; }
a.tile:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tile.static:hover { transform: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .7rem; color: var(--accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.chip { display: inline-block; background: var(--fill); border-radius: var(--r-pill); padding: .12rem .7rem; font-size: .78rem; color: var(--text); }
a.chip:hover { background: var(--text); color: #fff; text-decoration: none; }
.note { background: var(--amber-bg); border-radius: var(--r); padding: .5rem .75rem; margin-top: .5rem; }

/* ---------- Listen / Tabellen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .7rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; }
.list li:last-child { border-bottom: 0; }
.meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.action-needed { color: var(--red); font-weight: 600; font-size: .86rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: .75rem 1rem; background: transparent; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(0, 0, 0, .02); }
.table tr.dim td { color: var(--faint); }
.actions-cell { white-space: nowrap; }
.actions-cell > * { display: inline-block; vertical-align: top; margin: 0 .2rem .3rem 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.1rem; margin: .6rem 0; }
.kv dt { color: var(--muted); font-size: .86rem; } .kv dd { margin: 0; }
.kv.inline { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0; }
.kv.inline dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.kv.inline dd { margin-bottom: .2rem; font-weight: 520; }
.kv.inline > * { flex: none; }
.kv.inline dt, .kv.inline dd { display: inline; }

/* ---------- Badges & Buttons ---------- */
.badge { display: inline-block; padding: .12rem .65rem; border-radius: var(--r-pill); font-size: .75rem; font-weight: 600; background: var(--grey-bg); color: #55555a; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); } .badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); } .badge.blue { background: var(--blue-bg); color: var(--blue); } .badge.grey { background: var(--grey-bg); color: #6e6e73; }
.btn { display: inline-block; border: 0; background: var(--fill); color: var(--text); padding: .55rem 1.15rem; border-radius: var(--r-pill); font: inherit; font-weight: 580; font-size: .92rem; cursor: pointer; text-align: center; transition: background .15s, transform .1s; }
.btn:hover { background: rgba(0, 0, 0, .08); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; } .btn.primary:hover { background: var(--accent-d); }
.btn.danger { background: var(--red-bg); color: var(--red); } .btn.danger:hover { background: #f9d6d8; }
.btn.small { padding: .26rem .8rem; font-size: .8rem; }
.btn.block { display: block; width: 100%; padding: .75rem; font-size: 1rem; }
summary.btn { list-style: none; display: inline-block; } summary.btn::-webkit-details-marker { display: none; }
.inline { display: inline; }
.inline-details { display: inline-block; vertical-align: top; position: relative; }
.inline-details[open] > form { position: absolute; z-index: 10; min-width: 330px; right: 0; margin-top: .4rem; box-shadow: var(--shadow-hover), 0 0 0 1px var(--line); }

/* ---------- Formulare ---------- */
.field { margin-bottom: 1rem; }
.field label, .field .lbl { display: block; font-weight: 580; font-size: .84rem; margin-bottom: .3rem; color: #3a3a3c; }
.field.check label { font-weight: 480; font-size: .92rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; padding: .62rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--r); font: inherit; background: #fff; color: var(--text); margin-top: .25rem; transition: box-shadow .15s, border-color .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(0, 102, 204, .35); outline-offset: 2px; }
textarea { resize: vertical; min-height: 4rem; }
input[type=file] { margin-top: .25rem; width: 100%; font-size: .9rem; padding: .5rem; border: 1px dashed var(--line-strong); border-radius: var(--r); background: #fbfbfd; }
input[type=checkbox] { margin-right: .4rem; accent-color: var(--accent); width: 1rem; height: 1rem; vertical-align: -2px; }
input[type=radio] { accent-color: var(--accent); }
.hint { display: block; color: var(--faint); font-weight: 400; margin-top: .25rem; font-size: .8rem; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .2rem .9rem; max-height: 260px; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--r); padding: .6rem .85rem; background: #fcfcfd; }
.checklist label { font-weight: 480; font-size: .9rem; margin: 0; padding: .15rem 0; }
.multicheck .lbl { margin-bottom: .35rem; }
fieldset.vis { border: 1px solid var(--line); border-radius: var(--r-lg); padding: .7rem 1.2rem 0; margin: 1.1rem 0; background: #fcfcfd; }
fieldset.vis legend { font-weight: 650; padding: 0 .5rem; color: var(--text); }
.vis-deny { margin-bottom: .8rem; } .vis-deny summary { cursor: pointer; color: var(--blue); font-size: .88rem; margin-bottom: .5rem; }
.checks { margin: .4rem 0 .8rem; }
.form-actions { display: flex; gap: .6rem; margin-top: 1.1rem; }
.filter { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.filter input, .filter select { width: auto; margin: 0; min-width: 180px; border-radius: var(--r-pill); padding-left: 1rem; }
.filter.wide { flex: 1; min-width: 320px; } .filter.wide input { flex: 1; }
.filterbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: .9rem 1.1rem; }
.filterbar input, .filterbar select { width: auto; margin: 0; flex: 1 1 160px; border-radius: var(--r-pill); }
.row-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; } .row-form input { width: auto; flex: 1 1 200px; margin: 0; }
.inline-check { font-weight: 480; font-size: .9rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---------- Anmeldung ---------- */
body.is-public .shell { display: flex; justify-content: center; align-items: flex-start; padding-top: 3.5rem; }
body.is-public .main { width: 100%; display: flex; justify-content: center; flex-direction: column; align-items: center; }
.auth-card { background: var(--card); border-radius: 28px; box-shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 24px 60px rgba(0, 0, 0, .09); padding: 2.4rem 2.5rem; width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 780px; }
.auth-card h1 { margin-bottom: .35rem; }
.auth-links { margin: 1.3rem 0 0; font-size: .88rem; text-align: center; color: var(--muted); }
body.is-public .flash { width: 100%; max-width: 780px; }
body.is-public .topbar-in { justify-content: center; }

/* ---------- Hinweise ---------- */
.flash { padding: .8rem 1.1rem; border-radius: var(--r); margin-bottom: 1rem; }
.flash-ok { background: var(--green-bg); color: #155c36; } .flash-err { background: var(--red-bg); color: #8f1d22; }
.flash-warn { background: var(--amber-bg); color: #6a4500; }
.info-box { background: var(--blue-bg); border-radius: var(--r); padding: .9rem 1.1rem; margin: .8rem 0 1.2rem; font-size: .9rem; }
.hint-box { background: var(--fill); border-radius: var(--r); padding: .7rem 1rem; margin-top: .8rem; } .hint-box summary { cursor: pointer; font-weight: 600; }

/* ---------- Kennzahlen ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; display: flex; flex-direction: column; color: var(--text); transition: box-shadow .2s, transform .2s; }
a.kpi:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.kpi .n { font-size: 2.3rem; font-weight: 680; letter-spacing: -.03em; color: var(--text); line-height: 1.1; } .kpi .l { font-size: .82rem; color: var(--muted); }
.kpi.hot .n { color: #b86e00; } .kpi.alert .n { color: var(--red); }
.dot { display: inline-block; width: 9px; height: 9px; background: var(--accent); border-radius: 50%; margin-right: .45rem; vertical-align: middle; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; gap: .2rem; margin-bottom: 1.2rem; flex-wrap: wrap; background: var(--fill); padding: .25rem; border-radius: var(--r-pill); }
.tabs a { padding: .4rem 1.1rem; color: var(--muted); font-weight: 580; border-radius: var(--r-pill); font-size: .9rem; }
.tabs a.active { color: var(--text); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); } .tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .right-tab { font-weight: 500; }

/* ---------- Tickets / Reparaturen ---------- */
.ticket-head { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.thread { display: grid; gap: .9rem; margin-bottom: 1.3rem; }
.msg { border-radius: 18px 18px 18px 6px; padding: .8rem 1.05rem; background: var(--grey-bg); max-width: 90%; }
.msg.staff { background: var(--blue-bg); margin-left: auto; border-radius: 18px 18px 6px 18px; }
.msg.internal { background: var(--amber-bg); outline: 1px dashed #e5c374; }
.msg header { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .3rem; }
.msg time { margin-left: auto; }
.msg .body p:last-child { margin-bottom: 0; }
.files { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .25rem; }
.reply { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.decision-row { border-radius: var(--r); padding: .8rem 1rem; margin-bottom: .7rem; background: var(--bg); }
.decision-row summary { cursor: pointer; }
.decision-form { margin-top: .9rem; }
.compat { background: var(--amber-bg); border-radius: var(--r); padding: .7rem 1.1rem; margin-bottom: 1rem; }
.compat h3 { margin-top: 0; }
.download-box { background: var(--bg); border-radius: var(--r-lg); padding: 1.1rem 1.25rem; margin-top: 1.1rem; }
.download-box .confirm { display: block; margin-bottom: .9rem; font-weight: 480; }
address { font-style: normal; font-weight: 600; margin-bottom: .6rem; }
.note-row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.detail h3:first-child { margin-top: 0; }
.secret { font-size: 1.1rem; letter-spacing: .1em; }
.fw-block { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.1rem; } .fw-block h3 { margin-top: 0; }
.fw-upload { margin: .7rem 0; } .fw-upload > form { margin-top: .7rem; background: var(--bg); box-shadow: none; }

@media (max-width: 900px) {
  .shell.with-side { grid-template-columns: 1fr; }
  .side { position: static; display: flex; flex-wrap: wrap; gap: .2rem; } .side h4 { width: 100%; margin: .5rem .4rem 0; }
  .cols.two-one { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar-in { flex-wrap: wrap; gap: .8rem; } .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; } .uname { display: none; }
  .msg { max-width: 100%; }
  h1 { font-size: 1.6rem; }
}
@media print { .topbar, .side, .foot, .btn { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: 1px solid #ccc; } }
