/* M964 – skin taken from the Manufaktur 964 CMS (Website Building Test/clients/m964/site/app/admin/admin.css):
   light-grey surfaces, near-black sidebar, M964 red accent, Titillium Web (bundled, works offline).
   Client tokens live in :root only – swap these for another client. */
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/titillium-300-normal-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/titillium-300-normal-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/titillium-400-normal-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/titillium-400-normal-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/titillium-600-normal-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/titillium-600-normal-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/titillium-700-normal-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/titillium-700-normal-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #f5f5f5; --bg-dark: #e9e9e9; --panel: #ffffff; --ink: #1a1a1a; --ink-light: #2e2e2e; --text: #333333; --muted: #666666;
  --line: #e0e0e0; --rail: #1a1a1a; --accent: #b22234; --accent-deep: #8b1a29;
  --ok: #2f6b3a; --warn: #9a6400; --bad: #b22234; --info: #3c5a86;
  --ok-bg: #e7f1e8; --warn-bg: #fbf0dc; --bad-bg: #f8e3e5; --info-bg: #e5ecf6;
  --open: #fffaf0;   /* not billed yet: rows, totals, confirmation strip (one colour, see docs/DESIGN.md) */
  font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.rail { background: var(--rail); color: rgba(255,255,255,.85); display: flex; flex-direction: column; padding: 1.6rem 1.1rem; position: sticky; top: 0; height: 100vh; }
/* logo spans the nav width: same gap left and right as the nav items */
.brand { padding: .3rem .8rem 1.6rem; }
.brand img { display: block; width: 100%; height: auto; }
.navgroup { display: flex; flex-direction: column; gap: .15rem; margin-top: .4rem; }
.nav { display: block; color: rgba(255,255,255,.8); text-decoration: none; padding: .65rem .8rem; border-radius: 4px; font-size: .95rem; font-weight: 400; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; font-family: inherit; min-height: 0; transition: background .15s, color .15s; }
.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav.on { background: var(--accent); color: #fff; font-weight: 600; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: .15rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.rail-foot .nav { color: rgba(255,255,255,.6); font-size: .88rem; padding: .5rem .8rem; }
.pb { display: flex; align-items: center; gap: .5rem; padding: .9rem .8rem .1rem; }
.pb-mark { height: 15px; width: auto; fill: rgba(255,255,255,.4); flex-shrink: 0; }
.pb span { font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.ver { color: rgba(255,255,255,.3); font-size: .7rem; padding: .3rem .8rem 0; }
/* the content column sits centred in the space right of the nav, however wide the window */
main { padding: clamp(1.25rem,3vw,2.5rem) clamp(1.25rem,3vw,2.5rem) 80px; width: 100%; max-width: 1400px; min-width: 0; justify-self: center; }
h1 { font-size: 1.5rem; margin: 0 0 4px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 26px 0 10px; font-weight: 600; color: var(--ink); }
.sub { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; }
.stat b { display: block; font-size: 20px; margin-top: 4px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 12px; }
button, .btn { font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: .02em; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 13px; border-radius: 4px; cursor: pointer; min-height: 34px; }
button:hover { border-color: #aaa; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button.primary:hover { background: var(--ink-light); }
button.publish { background: var(--accent); color: #fff; border-color: var(--accent); }
button.publish:hover { background: var(--accent-deep); }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--accent); font-weight: 400; padding: 4px 6px; min-height: 0; text-decoration: underline; }
button:disabled { opacity: .45; cursor: default; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 7px 9px; border: 1.5px solid rgba(0,0,0,.14); border-radius: 4px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
textarea { resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; flex-wrap: wrap; }
.tab { padding: 9px 14px; cursor: pointer; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 6px 0 0; color: var(--muted); background: none; min-height: 0; }
.tab { text-decoration: none; }
.tab.on { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600; margin-bottom: -1px; box-shadow: inset 0 2px 0 var(--accent); }
table.t { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.t th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.t td { padding: 8px 10px; border-bottom: 1px solid #eeeeee; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--bg); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-grey { background: #ebebeb; color: #555; }
.issue { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 4px; margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line); }
.issue.fehler { border-left: 4px solid var(--bad); }
.issue.warnung { border-left: 4px solid var(--warn); }
.issue.info { border-left: 4px solid var(--info); }
.issue.done { opacity: .55; }
.issue .msg { flex: 1; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 7px; max-width: 520px; box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 1000; }
.toast.err { background: var(--bad); }
.lost { position: fixed; top: 0; left: 0; right: 0; background: var(--bad); color: #fff; padding: 12px; text-align: center; z-index: 20; }
/* invoice editor */
.ed-lines { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
.ed-lines th { font-size: 11.5px; color: var(--muted); text-align: left; padding: 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.ed-lines td { padding: 4px; border-bottom: 1px solid #eeeeee; vertical-align: top; }
.ed-lines input, .ed-lines select, .ed-lines textarea { width: 100%; padding: 5px 6px; font-size: 12.5px; }
.ed-lines .w-kind { width: 108px; } .ed-lines .w-nr { width: 150px; } .ed-lines .w-r { width: 58px; }
.ed-lines .w-q { width: 64px; } .ed-lines .w-e { width: 92px; } .ed-lines .w-g { width: 100px; } .ed-lines .w-act { width: 84px; }
.ed-lines .g { padding-top: 10px; }
.ed-lines tr.sec td { background: var(--bg-dark); font-weight: 600; font-size: 12px; padding: 7px 8px; }
.ed-lines .src { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ed-lines .free { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.ed-lines .free input { width: auto; }
.icon { min-height: 0; padding: 3px 7px; font-size: 12px; }
.totals { width: 340px; margin-left: auto; }
.invtot { margin-top: 12px; }
.invtot td { padding: 4px 8px; }
.totals td { padding: 5px 8px; }
.totals tr.big td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--ink); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(245,245,245,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.bar { height: 10px; border-radius: 4px; background: var(--bg-dark); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
details.inv { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; }
details.inv summary { padding: 10px 14px; cursor: pointer; display: flex; gap: 12px; align-items: center; }
details.inv .body { padding: 0 14px 12px; }
.locked-note { background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
/* office entry + catalogue */
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.steps span { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 7px 12px; font-size: 12.5px; color: var(--muted); }
.steps b { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; margin-right: 6px; }
.erf td { vertical-align: top; }
.chip { display: inline-block; font-size: 12px; font-weight: 400; padding: 3px 9px; min-height: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); margin: 2px 2px 2px 0; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--ink); }
details.card summary { cursor: pointer; }
/* projects */
.small-btn { font-size: 13px; padding: 6px 12px; min-height: 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: 0 8px 22px rgba(0,0,0,.08); transform: translateY(-2px); }
.pimg { position: relative; aspect-ratio: 4 / 3; background: var(--bg-dark); display: flex; align-items: center; justify-content: center; color: #b5b5b5; }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carph { width: 46%; height: auto; }
.pimg-btn { position: absolute; right: 8px; bottom: 8px; background: rgba(26,26,26,.72); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 4px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.pcard:hover .pimg-btn { opacity: 1; }
.pbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.pbody b { font-size: 15px; font-weight: 600; color: var(--ink); }
.pnew-grid { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.pnew-img { aspect-ratio: 4 / 3; border: 1.5px dashed rgba(0,0,0,.2); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--muted); overflow: hidden; }
.pnew-img:hover { border-color: var(--ink); }
.pnew-img img { width: 100%; height: 100%; object-fit: cover; }
.pnew-img span { font-size: 12px; }
.pnew-img .carph { width: 40%; }
.phead { display: flex; gap: 16px; align-items: center; margin: 8px 0 4px; }
.pthumb { width: 120px; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--bg-dark); display: flex; align-items: center; justify-content: center; color: #b5b5b5; cursor: pointer; flex: none; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.phead h1 { margin: 0; }
.addbar { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
button.big { font-size: 15px; padding: 12px 20px; }
.t .pre { white-space: pre-line; }
.t tfoot td { border-top: 2px solid var(--line); background: var(--bg); }
.stat.hot { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.t tr.isopen td { background: var(--open); }
.reword { margin-top: 6px; padding: 6px 8px; border-left: 2px solid var(--info); background: var(--info-bg); color: var(--ink); white-space: pre-line; }
.reword span { display: block; font-size: 11px; color: var(--info); font-weight: 600; }
/* import */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 30px; margin-bottom: 16px;
  border: 1.5px dashed rgba(0,0,0,.22); border-radius: 4px; background: var(--panel); cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.drop b { color: var(--ink); font-weight: 600; }
.drop:hover, .drop.over { border-color: var(--accent); background: #fff; }
.drop.busy { opacity: .6; pointer-events: none; }
.ifiles { margin-bottom: 16px; }
.icol .ed-lines td { vertical-align: top; }
.ed-lines tr.off td { opacity: .45; }
.ed-lines tr.off td:first-child { opacity: 1; }
.ifiles tr.ifile td:first-child { font-weight: 600; }
.ifiles .chev { display: inline-flex; width: 20px; color: var(--muted); vertical-align: -2px; }
.ifiles .chev svg { transition: transform .25s cubic-bezier(.4,0,.2,1); }
.ifiles tr.open .chev { color: var(--accent); }
.ifiles tr.open .chev svg { transform: rotate(90deg); }
.ifiles tr.open > td { background: #fff; }
.ifiles tr.ipre > td { padding: 0; background: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.iprob { color: var(--bad); margin-top: 2px; }
.gridpre { max-height: 440px; overflow: auto; margin: 4px 14px 14px 17px; border: 1px solid var(--line); border-radius: 4px; }
.gridpre table { border-collapse: collapse; font-size: 12px; width: 100%; }
.gridpre th { position: sticky; left: 0; background: var(--bg); color: var(--muted); font-weight: 400; text-align: right; padding: 3px 8px; width: 34px; border-right: 1px solid var(--line); }
.gridpre td { padding: 3px 8px; border-bottom: 1px solid #f0f0f0; white-space: pre-wrap; vertical-align: top; max-width: 520px; }
.gridpre tr.dhead td { font-weight: 600; background: var(--bg); }
.gridpre tr.bad td, .gridpre tr.bad th { background: var(--bad-bg); color: var(--bad); }
.gridpre tr.hl td, .gridpre tr.hl th { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.pdfpre { margin: 4px 14px 14px 17px; padding: 14px; max-height: 640px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.pdfpre img { display: block; width: 100%; max-width: 860px; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
input.warnin { border-color: var(--warn); }
/* every value of a row sits on the same first line (baseline), same size; the pencil on that line too */
.irows td { vertical-align: baseline; padding: 11px 8px; font-size: 14px; line-height: 1.45; }
.irows td.pre { white-space: pre-line; }
.irows tr.editing td { vertical-align: top; }
.irows td .src, .irows td .small { line-height: 1.4; }
.irows td:last-child { vertical-align: top; padding-top: 7px; text-align: right; }
.irows .w-pen { width: 40px; }
.irows tr.editing > td { background: var(--info-bg); }
.irows .numin { text-align: right; }
.irows .vsel { width: 100%; font-size: 13px; }
.irows b.pno { font-weight: 700; color: var(--ink); }
.irows td .vsel { margin-top: -6px; margin-bottom: -6px; }
.pen { min-height: 0; width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: none; color: var(--muted); border-radius: 4px; cursor: pointer; }
.pen:hover { color: var(--ink); border-color: var(--line); background: #fff; }
.pen.on { color: #fff; background: var(--ink); border-color: var(--ink); }
.pflag { color: var(--warn); font-weight: 600; }
.modal { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(0,0,0,.38); animation: popIn .14s ease-out; }
.modal-box { width: min(520px, 100%); background: #fff; border-radius: 8px; padding: 1.4rem 1.5rem 1.2rem; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.kupd { color: var(--info); font-weight: 600; }
.iask td { background: var(--info-bg); font-size: 13px; padding: 8px; }
.iaddbox { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
@media (max-width: 900px) { .pnew-grid { grid-template-columns: 1fr; } }
/* parts catalogue */
.kbar { margin: 12px 0 14px; }
.kbar input { font-size: 15px; padding: 9px 36px 9px 12px; }
.kbar select { min-width: 240px; font-size: 15px; padding-top: 9px; padding-bottom: 9px; }
.kform { display: grid; grid-template-columns: 1.2fr 2fr 1.4fr .8fr .8fr; gap: 10px; }
.pno { font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: .02em; }
.vtag { display: inline-block; margin-left: 8px; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--bg-dark); color: var(--muted); }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover, .t th.sortable.on { color: var(--ink); }
.t th .arr { display: inline-block; min-width: 1em; }
.t th.mid, .t td.mid { text-align: center; }
.t th.num { text-align: right; }     /* column titles sit over their numbers */
table.kat tr.krow.open > td { background: #fff; font-weight: 600; box-shadow: inset 0 -1px 0 var(--line); }
table.kat tr.krow.open > td:first-child { box-shadow: inset 3px 0 0 var(--accent), inset 0 -1px 0 var(--line); }
table.kat tr.kdet > td { padding: 0; background: #fff; border-bottom: 1px solid var(--line); }
table.kat tr.kdet > td { box-shadow: inset 3px 0 0 var(--accent); }
.kpanel { padding: 6px 18px 18px 21px; }
.khead { display: flex; gap: 36px; align-items: flex-start; margin: 6px 0 14px; }
.khead .kst { min-width: 150px; }   /* three mini stat cards: titles on one line, value or – below */
.khead .lbl { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.khead b { font-size: 20px; font-weight: 600; color: var(--ink); }
.khead label.f { min-width: 240px; }
.kvar { border-color: var(--line); }
.kvar tr.kv.open > td { background: var(--bg); }
.kvar tr.khist > td { padding: 0; border-bottom: 0; }
.khist-in { padding: 4px 10px 12px 28px; background: var(--bg); }
.sbox { position: relative; flex: 1; min-width: 260px; display: flex; }
.sbox input { flex: 1; padding-right: 36px; }
.sclear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 0; width: 26px; height: 26px; padding: 0;
  border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; font-weight: 400; cursor: pointer; }
.sclear:hover { color: var(--accent); }
input.bad { border-color: var(--bad); }
.taken { font-size: 12px; color: var(--bad); }
.taken .link { padding: 0 2px; font-size: 12px; }
.kdel { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--bad); border-radius: 4px; background: var(--bad-bg); }
.kdel p { margin: 0 0 8px; }
.kdel input { width: 220px; font-variant-numeric: tabular-nums; }
.kform3 { grid-template-columns: 1.2fr 2.4fr 1.4fr .8fr; margin-bottom: 12px; }
.kedit { padding-top: 4px; }
.kedit .kvar td { vertical-align: middle; }
.kedit .kvar input, .kedit .kvar select { width: 100%; }
.kedit .numin { text-align: right; }
.kedit tr.gone td { opacity: .4; text-decoration: line-through; }
.xbtn { min-height: 0; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.xbtn:hover { color: var(--accent); }
/* smooth open / close: grid row 0fr -> 1fr */
.slide { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.4,0,.2,1); }
.slide.open { grid-template-rows: 1fr; }
.slide.now { transition: none; }
.slide-in { overflow: hidden; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }
/* dropdowns - from the M964 CMS (admin.css 'Dropdowns + dialogs'): own chevron inset like the text, styled open list */
select:not([multiple]) { -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9em center; background-size: .72em auto; padding-right: 2.5em; text-overflow: ellipsis; }
select:not([multiple]):disabled { cursor: default; opacity: .6; }
.cms-pop { position: fixed; z-index: 2000; box-sizing: border-box; max-width: min(560px, calc(100vw - 16px)); overflow-y: auto; overscroll-behavior: contain;
  padding: .3rem; background: #fff; border: 1px solid rgba(0,0,0,.14); border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.08);
  font-family: inherit; font-size: .95rem; line-height: 1.35; color: var(--text); animation: popIn .12s ease-out; }
.cms-pop__opt { position: relative; padding: .55rem .9rem .55rem 2.1rem; border-radius: 4px; cursor: pointer; }
.cms-pop__opt.is-active { background: var(--bg); }
.cms-pop__opt.is-selected { color: var(--ink); font-weight: 600; }
.cms-pop__opt.is-selected::before { content: ""; position: absolute; left: .85rem; top: 50%; width: .32rem; height: .62rem;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: translateY(-62%) rotate(45deg); }
.cms-pop__opt.is-disabled { color: var(--muted); opacity: .55; cursor: default; }
.cms-pop__group { padding: .65rem .9rem .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .kform { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .brand, .rail-foot .pb, .ver { display: none; } .rail-foot { margin: 0; border: 0; padding: 0; } .grid2, .grid4 { grid-template-columns: 1fr; } main { padding: 18px 16px 60px; } }

/* project lists: open rows can be corrected with the pencil, billed ones are locked */
.t.pedit td { vertical-align: middle; }                 /* every cell of a row on one centre line */
.t.pedit th.pcol, .t.pedit td.pcol { width: 44px; text-align: right; padding-left: 0; }   /* pencil always far right */
.t.pedit tr.editing > td { background: var(--info-bg); vertical-align: top; }
.t.pedit tr.editing input, .t.pedit tr.editing select, .t.pedit tr.editing textarea { width: 100%; padding: 5px 6px; font-size: 13px; }
.t.pedit tr.editing .numin { text-align: right; }
.vsum { margin-bottom: 10px; }
.kconf { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--warn); border-radius: 4px; background: var(--open); }
.kconf p { margin: 0 0 8px; }

/* one edit pattern: fields, then Speichern / Abbrechen, then the confirmation strip right underneath */
.t.pedit tr.ebar > td { background: var(--info-bg); padding: 4px 10px 12px; border-bottom: 1px solid var(--line); }
.ebar-in { display: flex; gap: 8px; align-items: center; }
.cstrip { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--warn); border-radius: 4px; background: var(--open); font-size: 13.5px; }
.cstrip-t { margin-bottom: 8px; line-height: 1.5; }
.cstrip-t input { margin-top: 8px; width: 220px; font-variant-numeric: tabular-nums; }
.cstrip-b { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pen.bin:hover { color: var(--bad); border-color: var(--bad); }
.t.pedit tr.editing > td { border-bottom: 0; }

/* price history inside the variant table: same columns, a date on the left, only what changed */
/* fixed column widths: opening a history never moves the columns; no bold on the open row (bold changes widths) */
table.kvread { table-layout: fixed; }
.kvread td, .kvread th { overflow-wrap: anywhere; }
.kvar tr.kv.open > td { background: #fff; }
.kvar tr.kv.open > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* history rows are always there, closed at zero height; they slide open together (same 0fr -> 1fr as the rows above) */
.kvar tr.khr > td { background: #fafafa; font-size: 13px; padding-top: 0; padding-bottom: 0; border-bottom: 0 solid #f0f0f0;
  transition: padding .28s ease; }
.kvar tr.khr.open > td { padding-top: 7px; padding-bottom: 7px; border-bottom-width: 1px; }
.kvar tr.khr > td.khd { padding-left: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kvar tr.khr .hs { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.kvar tr.khr .hs > div { overflow: hidden; min-height: 0; }
.kvar tr.khr.open .hs { grid-template-rows: 1fr; }
/* project parts: an opened part gets the same red edge as in the catalogue */
table.pedit tr.krow.open > td { background: #fff; font-weight: 600; box-shadow: inset 0 -1px 0 var(--line); }
table.pedit tr.krow.open > td:first-child { box-shadow: inset 3px 0 0 var(--accent), inset 0 -1px 0 var(--line); }
table.pedit tr.kdet > td { padding: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--accent); }
.stat.click { cursor: pointer; transition: border-color .15s ease; }
.stat.click:hover { border-color: var(--ink); }

/* project cards: billing state in one line – black when all billed, red with the open amount */
.pstate { display: block; font-size: 13px; margin-top: 3px; color: var(--ink); }
.pstate.open { color: var(--bad); font-weight: 600; }
.pstate.muted { color: var(--muted); }
/* project settings */
.pset-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.pset .pnew-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) { .pset-grid { grid-template-columns: 1fr; } }
.psimg { position: relative; }
.psimg .psprev { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.psimg .psprev img { width: 100%; height: 100%; object-fit: cover; }
.psimg .pscap { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px; text-align: center; background: rgba(255,255,255,.85); }
.t tr.allclear td { text-align: center; padding: 34px 10px; color: var(--muted); font-size: 15px; }
.drop.dbdrop { padding: 54px 30px; gap: 12px; margin-bottom: 18px; }
.drop.dbdrop span { font-size: 13px; }
.t tfoot tr.opensum td { background: var(--open); }
/* Fahrzeug gesamt */
.vtot tr.evrow td { background: var(--bg); font-size: 13px; padding: 7px 10px; }
.vtot tr.curper td { background: #fff; }
.elhead { margin: 30px 0 12px; align-items: center; }
.elhead h2 { margin: 0; }
@media (max-width: 900px) { .elhead + .card .kform { grid-template-columns: 1fr !important; } }
/* an open 'new entry' card: red dashed edge (like the drop zone on hover) and air to the button above */
.card.newcard { border: 1.5px dashed var(--accent); margin-top: 14px; }
.kform.kform6 { grid-template-columns: 1.2fr 2fr 1.4fr .8fr .8fr .8fr; }
@media (max-width: 900px) { .kform.kform6 { grid-template-columns: 1fr; } }
/* '+ Position' card */
.ptabs { display: flex; gap: 6px; margin-bottom: 12px; }
.ptabs button { min-height: 0; padding: 6px 12px; font-size: 13px; }
.ptabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.psres { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 10px; }
.psitem { display: flex; align-items: baseline; gap: 6px; text-align: left; min-height: 0; padding: 8px 10px; font-weight: 400; background: #fff; border: 1px solid var(--line); }
.psitem:hover { border-color: var(--accent); }
.pspick { margin: 4px 0 10px; padding: 8px 10px; background: var(--bg); border-radius: 4px; }
.navhead { margin: 1.3rem 0 .3rem; padding: 0 .8rem; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.45); font-weight: 600; }
@media (max-width: 900px) { .navhead { display: none; } }
.kform.kform5 { grid-template-columns: 1.2fr 2.4fr .9fr .9fr .9fr; }
@media (max-width: 900px) { .kform.kform5 { grid-template-columns: 1fr; } }
.kform.kform7 { grid-template-columns: 1fr 2fr .8fr 1.2fr 1.4fr .8fr .8fr; }
@media (max-width: 900px) { .kform.kform7 { grid-template-columns: 1fr; } }
.psitem.psnew { color: var(--accent); }
a.invlink { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.khead .kst.kprice b { color: var(--accent); }   /* the price is what the eye should find first */
.psread { cursor: default; border-style: solid; border-color: var(--line); }
.psread:hover { border-color: var(--line); }
.psinfo { flex-wrap: wrap; margin-top: 0; }
/* logins – the website CMS's login, rule for rule (site/app/admin/admin.css ".login", David 2026-11-22):
   dark page, white card, black logo, grey fields, red uppercase button. Covers the whole window, rail included. */
.login { --navy: #1a1a1a; --copper: #b22234; --copper-deep: #8b1a29; --text-light: #666666;
  --font-sans: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  position: fixed; inset: 0; z-index: 900; overflow-y: auto; min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--navy); padding: 2rem; font-family: var(--font-sans); }
.login * { box-sizing: border-box; }
.login__card { width: 100%; max-width: 420px; background: #fff; border-radius: 6px; padding: 2.6rem 2.4rem; margin: auto; }
.login__card--wide { max-width: 760px; }
.login__brand { display: block; height: auto; width: 240px; max-width: 100%; margin: 0 auto 2rem; filter: brightness(0); }
.login__err { background: rgba(138,43,34,.1); color: #8a2b22; font-size: .85rem; padding: .6rem .8rem; border-radius: 4px; margin-bottom: 1rem; }
.login__err[hidden] { display: none; }
.login .field { margin-bottom: .7rem; }
.login .field label { display: block; font-size: 18px; font-weight: 400; color: #1a1a1a; margin-bottom: 5px; letter-spacing: 0; text-transform: none; }
.login .field input { display: block; width: 100%; min-height: 0; font-family: var(--font-sans); font-size: 18px; font-weight: 400; color: #1a1a1a;
  background: #e8e8e8; border: 1px solid transparent; border-radius: 4px; padding: 12px 14px; outline: none; box-shadow: none;
  -webkit-appearance: none; appearance: none; transition: border-color .2s ease, background .2s ease; }
.login .field input:focus { border-color: #1a1a1a; background: #fff; }
.login .btn { width: 100%; display: block; text-align: center; margin-top: 1.8rem; min-height: 0; font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--copper); border: none; border-radius: 6px;
  padding: 16px 24px; cursor: pointer; transition: background .2s ease, transform .15s ease; }
.login .btn:hover { background: var(--copper-deep); transform: translateY(-1px); }
.login .btn:disabled { opacity: .6; transform: none; }
/* first start only (accounts): the same card, wider – one row per account */
.login__lead { font-size: .88rem; color: var(--text-light); margin: 0 0 1.2rem; }
.login__role { font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #1a1a1a; margin: 1rem 0 .4rem; }
.login__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .login__row { grid-template-columns: 1fr; } .login__card { padding: 2rem 1.4rem; } }
body.nologin .rail .navgroup, body.nologin #logoutBtn { display: none; }
.whoami { padding: .4rem .8rem; color: rgba(255,255,255,.85); font-size: .88rem; }
.whoami span { display: block; font-size: .72rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .08em; }
a.btn.publish { background: var(--accent); color: #fff; border-color: var(--accent); }
a.btn.publish:hover { background: var(--accent-deep); }
.offhead { margin: 16px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.t.pedit tr.off td { opacity: .6; }
/* '+ Position' search results: one tidy line each – number | name (cut off, full text on hover) | group | price */
.psitem:not(.psnew) { display: grid; grid-template-columns: 200px minmax(0, 1fr) 170px 120px; gap: 14px; align-items: center; }
.psitem .psno, .psitem .psname, .psitem .psgrp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psitem .psprice { text-align: right; white-space: nowrap; }
.pssum .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pssum > div { display: flex; align-items: center; gap: 6px; min-height: 38px; }
@media (max-width: 900px) { .psitem:not(.psnew) { grid-template-columns: 1fr; gap: 2px; } }
.khead .kbtns { display: flex; gap: 8px; }
.kform.pscompact { justify-content: start; margin-top: 10px; }
.psstats { margin: 4px 0 2px; }
/* links (also the "←" back links): M964 red, also once visited – never the browser blue / purple */
main a:not(.btn):not(.tab), main a:not(.btn):not(.tab):visited { color: var(--accent); }
main a:not(.btn):not(.tab):hover { color: var(--accent-deep); }
/* provisional number in the invoices list: bold like a real invoice number, no button padding (row stays on one line) */
button.link.pno { font-weight: 700; font-size: inherit; line-height: inherit; padding: 0; vertical-align: baseline; letter-spacing: inherit; }
/* deviations: numbers changed in Excel, not taken over (David 2026-11-20) */
tr.devrow td { color: var(--bad); }
.devlist { margin: 6px 0 0 18px; padding: 0; color: var(--bad); font-size: 13px; }

/* percent rule in Bearbeiten (VK = base − X %), own variants on an import row, Rabattgruppen – 2026-11-21 */
.kedit .kvar .vkrule { display: flex; gap: 6px; align-items: center; }
.kedit .kvar .vkrule select { width: auto; flex: 1 1 55%; min-width: 0; }
.kedit .kvar .vkrule input { flex: 1 1 45%; min-width: 0; }
.kedit .kvar .vkrule input.pctin { flex: 0 0 64px; width: 64px; }
.kedit .kvar .vkrule .calc { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.ownf { display: block; margin-top: 8px; }
.ownf select { width: 100%; }
.dgin { width: 90px; }
/* new-part card = Bearbeiten with Rabattgruppe; percent field in the variant dialog – 2026-11-21 */
.modal .vkrule { display: flex; gap: 6px; align-items: center; }
.modal .vkrule input.pctin { flex: 0 0 72px; width: 72px; }
.modal .vkrule .calc { white-space: nowrap; color: var(--muted); }

/* a part with several numbers (superseded): "(alte Nummern)" in the variant row, the numbers pop-up – 2026-11-21 */
button.nolink { background: none; border: 0; padding: 0; min-height: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
button.nolink:hover { color: var(--accent); }
.nmtab td { vertical-align: middle; }

/* import rows (David 2026-11-21): every note on a part is red and so is its number; open price decisions get the button
   "Preisentscheidung" that opens the row */
.src.inote { color: var(--bad); font-weight: 600; }
b.pno.pchg, .irows b.pno.pchg { color: var(--bad); }
button.decbtn { margin-top: 6px; color: var(--bad); border-color: var(--bad); font-weight: 600; }
.sticky-actions button.decbtn { margin: 0 0 0 12px; }
select.ivar { min-width: 0; width: 100%; }
[hidden] { display: none !important; }            /* a hidden field stays hidden, whatever its own display */
.modal-box.wide { width: min(1080px, 100%); max-height: 92vh; overflow: auto; }
input.numin[readonly] { background: var(--bg); color: var(--muted); cursor: not-allowed; }
/* Bearbeiten's variant table: fixed columns – switching "% von Porsche" / Festpreis never moves them (David 2026-11-21) */
.kedit table.kvedit { table-layout: fixed; width: 100%; }
.ghint { display: block; margin-top: 4px; }
.ghint:empty { display: none; }
.locked-note.bad { background: #fbeaea; color: var(--bad); font-weight: 600; }
/* the part's note (David 2026-11-21): beside the stat cards on the expanded part, a full row in Bearbeiten */
.khead .kst.knote { min-width: 180px; max-width: 360px; }
.khead .kst.knote .small { color: var(--text); line-height: 1.4; }
.kform3 .knotef { grid-column: 1 / -1; }
.kform3 .knotef textarea { width: 100%; }
/* a new Porsche name on an import row: information, not a change to decide – copper, not red (David 2026-11-21) */
.src.cnote { color: #a45d24; font-weight: 600; }
.pedit .vkrule { display: flex; gap: 6px; align-items: center; }
.pedit .vkrule input { flex: 1 1 auto; min-width: 0; }
/* Leistung / Betriebsstoff on an import row: the same text as a drop-down, without the drop-down (David 2026-11-21) */
.ivar-static { display: block; font-size: 14px; padding: 7px 9px; border: 1.5px solid transparent; color: var(--ink); line-height: normal; }
