:root {
  --side: #12161c; --side-hi: #1c222b; --side-text: #c9d1d9; --side-mute: #7d8793;
  --bg: #f6f7f5; --card: #fff; --line: #e4e7e3; --text: #14181d; --mute: #5f6b76;
  --green: #3f8a46; --green-d: #2f6d36; --green-bg: #e6f2e7; --red: #c0392b; --red-bg: #fbeae8;
  --blue: #2563eb; --blue-bg: #e7efff; --amber: #b7791f; --amber-bg: #fdf3dd; --grey: #e9ecef;
  --radius: 16px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.shell { display: grid; grid-template-columns: 238px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 14px 8px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--green); color: #fff; font-weight: 800; display: grid; place-items: center; }
.brand b { display: block; color: #fff; line-height: 1.1; }
.brand small { color: var(--side-mute); font-size: 12px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--side-text); text-decoration: none; border-left: 3px solid transparent; font-weight: 500; }
.nav a:hover { background: var(--side-hi); }
.nav a.on { background: var(--side-hi); border-left-color: var(--green); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side .foot { margin-top: auto; }
.side .foot button { width: 100%; background: none; border: 0; color: var(--side-mute); text-align: left; padding: 10px 12px; cursor: pointer; border-radius: 8px; }
.side .foot button:hover { background: var(--side-hi); color: #fff; }

.main { padding: 28px 24px 60px; }
.page { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--green); text-transform: uppercase; }
.head h1 { font-size: 30px; letter-spacing: -.02em; margin-top: 2px; }
.head p { color: var(--mute); margin-top: 6px; }
.actions { display: flex; gap: 10px; }

.btn { color: var(--text); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #cfd5cc; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgb(20 24 29 / .04); }
.card h2 { font-size: 17px; }
.card .sub { color: var(--mute); font-size: 13.5px; margin-top: 2px; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.cardhead a { color: var(--mute); font-weight: 600; text-decoration: none; font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { display: flex; gap: 14px; align-items: flex-start; }
.ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ico svg { width: 20px; height: 20px; }
.ico.g { background: var(--green-bg); color: var(--green); } .ico.b { background: var(--blue-bg); color: var(--blue); } .ico.a { background: var(--amber-bg); color: var(--amber); }
.stat .lbl { font-size: 13.5px; color: var(--mute); }
.stat .val { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat .note { font-size: 12.5px; color: var(--mute); margin-top: 2px; }
.pill { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--green-bg); color: var(--green); vertical-align: middle; margin-left: 4px; }
.pill.down { background: var(--red-bg); color: var(--red); }

.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 22px; border-bottom: 1px solid var(--line); }
.col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.col .n { font-size: 11.5px; color: var(--mute); font-weight: 600; }
.bar { width: 100%; max-width: 38px; background: var(--grey); border-radius: 6px 6px 3px 3px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 3px; }
.bar i { display: block; background: linear-gradient(#5aa361, var(--green)); }
.col.today .bar { outline: 2px solid #d3a82b; }
.days { display: flex; gap: 10px; margin-top: 8px; }
.days span { flex: 1; text-align: center; font-size: 12px; color: var(--mute); }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--mute); margin-top: 14px; }
.legend b { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.av { width: 38px; height: 38px; border-radius: 50%; background: #d6457f; color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; font-size: 13px; }
.item .t { flex: 1; min-width: 0; }
.item .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t small { color: var(--mute); font-size: 13px; }
.badge { padding: 4px 11px; border-radius: 8px; font-weight: 700; font-size: 13px; background: var(--grey); color: var(--mute); white-space: nowrap; }
.badge.ok { background: var(--green); color: #fff; } .badge.no { background: var(--red); color: #fff; } .badge.plan { background: var(--blue-bg); color: var(--blue); } .badge.act { background: var(--green-bg); color: var(--green); }
.empty { color: var(--mute); padding: 18px 0; text-align: center; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #fafbf9; }
td.r, th.r { text-align: right; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.form { display: grid; gap: 18px; max-width: 760px; }
.field { display: grid; gap: 6px; }
.field > label, .lbl2 { font-weight: 600; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--mute); }
input[type=text], input[type=date], input[type=number], input[type=password], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cfd5cc; border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.seg { display: inline-flex; border: 1px solid #cfd5cc; border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 9px 16px; cursor: pointer; font-weight: 600; color: var(--mute); }
.seg button.on { background: var(--green); color: #fff; }
.opt { display: flex; gap: 8px; align-items: center; }
.opt input[type=radio] { accent-color: var(--green); width: 18px; height: 18px; }
.opt .btn { padding: 8px 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.err { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 10px; font-weight: 600; }

.stage { position: relative; display: block; width: fit-content; justify-self: start; max-width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: crosshair; background: #eee; line-height: 0; }
.stage img { display: block; max-width: 100%; max-height: 420px; user-select: none; -webkit-user-drag: none; }
.spot { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid var(--blue); background: rgb(37 99 235 / .18); border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; line-height: 1; pointer-events: none; }
.spot.ok { border-color: var(--green); background: rgb(63 138 70 / .25); }
.spot span { background: rgb(0 0 0 / .65); padding: 2px 5px; border-radius: 5px; }
.spotrow { display: grid; grid-template-columns: 1.4fr .7fr .7fr .7fr auto auto; gap: 8px; align-items: center; }

.res { display: grid; grid-template-columns: 150px 1fr 90px; gap: 14px; align-items: center; padding: 8px 0; }
.res .track { height: 26px; background: var(--grey); border-radius: 8px; overflow: hidden; }
.res .track i { display: block; height: 100%; background: var(--blue); border-radius: 8px; }
.res.ok .track i { background: var(--green); }
.res .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.res .v small { color: var(--mute); font-weight: 500; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login .brand { padding: 0; color: var(--text); } .login .brand b { color: var(--text); }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--side); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { padding: 4px 8px; } .side .foot { margin: 0 0 0 auto; }
  .stats { grid-template-columns: 1fr 1fr; } .grid2 { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 50px; }
}
@media (max-width: 560px) { .stats, .two { grid-template-columns: 1fr; } .res { grid-template-columns: 90px 1fr 70px; } .spotrow { grid-template-columns: 1fr 1fr; } }

/* Bereiche im Editor: verschieben und in der Grösse ändern */
.spot.editable { pointer-events: auto; cursor: move; touch-action: none; }
.spot .handle { position: absolute; right: 0; top: 50%; width: 16px; height: 16px; transform: translate(50%, -50%); background: #fff; border: 3px solid var(--blue); border-radius: 50%; cursor: ew-resize; touch-action: none; }
.spot.ok .handle { border-color: var(--green); }
.spotrow { grid-template-columns: 1.3fr 1.2fr auto auto; padding: 8px 0; border-bottom: 1px solid var(--line); }
.spotrow .sizefield { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--mute); }
.spotrow .sizefield input { width: 100%; accent-color: var(--green); }
.spotrow .xyr { grid-column: 1 / -1; display: flex; gap: 10px; font-size: 12.5px; color: var(--mute); }
.spotrow .xyr input { width: 84px; padding: 6px 8px; }
.opt input[type=checkbox] { accent-color: var(--green); width: 18px; height: 18px; }
.evalcard { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.evalcard > div:first-child { flex: 1; min-width: 260px; }

.notice { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border-radius: 14px; background: var(--amber-bg); border: 1px solid #ecd9a6; }
.notice .hint { margin-top: 2px; }
