/* CC Tracking Tool – „Leitstand“: dunkle Navigationsleiste, ruhige Arbeitsfläche, Projektfarbe als Akzent.
   Nur lokale Systemschriften (offline), Ziffern in gleicher Breite für saubere Zahlenspalten. */
:root {
  --ink: #12343b; --ink-2: #1c4851; --ink-text: #c9dadb;
  --canvas: #f3f6f5; --surface: #fff; --line: #dbe3e2; --line-2: #eef2f1;
  --text: #1b2528; --muted: #5d6b6e;
  --accent: #1f6f8b; --accent-soft: color-mix(in srgb, var(--accent) 10%, white);
  --amber: #a85f00; --amber-soft: #fff4e2; --red: #b3261e; --red-soft: #fdecea; --green: #2e7d4f; --green-soft: #e8f4ec;
  --radius: 10px; --radius-s: 6px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--canvas); line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Grundgerüst ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) 232px, transparent 232px); }
.rail { background: var(--ink); color: var(--ink-text); padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--nav-strong, #fff); font-weight: 650; font-size: 1.02rem; padding: .2rem .5rem 1.2rem; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; font-size: .8rem; color: var(--on-accent, #fff); }
.navgroup { margin-bottom: 1rem; }
.navgroup > span { display: block; font-size: .78rem; color: var(--nav-heading, #87a5a8); padding: 0 .55rem .3rem; }
.navgroup a { display: flex; align-items: center; justify-content: space-between; color: var(--ink-text); text-decoration: none;
  padding: .42rem .55rem; border-radius: var(--radius-s); font-size: .93rem; }
.navgroup a:hover { background: var(--ink-2); color: var(--nav-strong, #fff); }
.navgroup a.on { background: var(--nav-strong, #fff); color: var(--ink); font-weight: 600; }
.counter { background: var(--amber); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; justify-content: flex-end; padding: .65rem 1.8rem;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: .55rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff); display: grid; place-items: center;
  font-size: .8rem; font-weight: 600; flex: none; }
.who small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.1; }
.content { padding: 1.6rem 1.8rem 3rem; max-width: 1480px; width: 100%; }

/* ---------- Typografie ---------- */
h1 { font-size: 1.75rem; font-weight: 650; margin: 0 0 .2rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 650; margin: 1.8rem 0 .7rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.2rem 0 .5rem; }
.lead { color: var(--muted); margin: 0 0 1.4rem; max-width: 72ch; }
small, .hint { color: var(--muted); font-size: .84rem; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.pagehead h1 { display: flex; align-items: center; gap: .7rem; }

/* ---------- Flächen ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
main > form.inline + .panel { margin-top: 1rem; }

/* ---------- Formulare & Knöpfe ---------- */
label { display: block; margin: .35rem 0; font-size: .9rem; }
.row { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; margin: .35rem 0; }
.row label { margin: 0; }
input, select, textarea {
  font: inherit; color: inherit; height: 36px; padding: 0 .65rem; border: 1px solid #c7d2d1; border-radius: var(--radius-s); background: #fff;
}
input[type=checkbox], input[type=radio] { height: auto; accent-color: var(--accent); }
input[type=file] { padding: .35rem; height: auto; }
input:focus, select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
button, .button {
  font: inherit; height: 36px; padding: 0 .95rem; border-radius: var(--radius-s); border: 1px solid #c7d2d1; background: #fff;
  color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { border-color: var(--muted); }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); font-weight: 600; }
button.primary:hover, a.button.primary:hover { filter: brightness(.93); }
button.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 .5rem; }
button.ghost:hover { background: var(--accent-soft); }
button.danger { color: var(--red); border-color: #e7b9b5; }
button.small, .actions button, .actions input { height: 30px; font-size: .86rem; padding: 0 .6rem; }
.topbar .logout { border-color: var(--line); }
form.inline { display: inline; }

/* ---------- Meldungen & Kennzeichen ---------- */
.error, .ok { padding: .65rem .9rem; border-radius: var(--radius-s); margin: 0 0 1rem; }
.error { background: var(--red-soft); color: var(--red); border-left: 4px solid var(--red); }
.ok { background: var(--green-soft); color: var(--green); border-left: 4px solid var(--green); }
.badge { display: inline-block; background: var(--line-2); color: var(--text); border-radius: 999px; padding: .05rem .55rem; font-size: .8rem; font-weight: 500; }
h1 .badge { font-size: .8rem; vertical-align: middle; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.good { background: var(--green-soft); color: var(--green); }
.badge.off { background: #eceff0; color: var(--muted); text-decoration: line-through; }
.role { display: inline-block; border-radius: 999px; padding: .08rem .6rem; font-size: .8rem; font-weight: 600; }
.role-agent { background: #e7f0f7; color: #1e5a86; }
.role-teamleiter { background: #eaf4ec; color: #2e6b45; }
.role-projektleiter { background: #f3ecf8; color: #6a3f8a; }
.role-leitung { background: #fdf0e1; color: #8a5200; }
.role-admin { background: #eceff0; color: #46555a; }

/* ---------- Tabellen ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1.2rem; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
thead th, tr:first-child > th { background: #f7f9f9; color: var(--muted); font-weight: 600; font-size: .82rem; white-space: nowrap; position: sticky; top: 0; }
th small { display: block; font-weight: 400; font-size: .74rem; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:hover td, tr:hover > td { background: #fafcfc; }
tr.total td { font-weight: 650; background: #f7f9f9; border-top: 1px solid var(--line); }
tr.due td { background: var(--amber-soft); }
.tablewrap td:first-child, .tablewrap th:first-child { white-space: nowrap; }
.panel table { font-size: .9rem; }
td .muted, .muted { color: var(--muted); }

/* ---------- Kennzahlen-Tafel (Auswertung) ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); margin: 0 0 1.6rem; }
.tile { padding: 1rem 1.2rem 1.05rem; border-left: 1px solid var(--line-2); }
.tile:first-child { border-left: 0; }
.tile b { display: block; font-size: 2.1rem; font-weight: 650; line-height: 1.05; letter-spacing: -.02em; color: var(--text); }
.tile > span { display: block; color: var(--muted); font-size: .86rem; margin-top: .25rem; }
.tile em { font-style: normal; color: var(--muted); font-size: .8rem; }

/* ---------- Werkzeugleisten, Dialoge, Ausklapper ---------- */
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .9rem; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar input[type=search] { width: 100%; }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, 94vw); box-shadow: 0 24px 60px rgba(18, 52, 59, .28); }
dialog::backdrop { background: rgba(18, 52, 59, .45); }
dialog header { padding: 1rem 1.3rem .2rem; display: flex; justify-content: space-between; align-items: center; }
dialog header h2 { margin: 0; }
dialog .body { padding: .4rem 1.3rem 1.3rem; }
dialog section { border-top: 1px solid var(--line-2); padding-top: .8rem; margin-top: .8rem; }
dialog section h3 { margin: 0 0 .45rem; font-size: .92rem; }
.checks { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.checks label { display: flex; gap: .35rem; align-items: center; margin: 0; }
details.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.2rem; }
details.fold > summary { cursor: pointer; padding: .8rem 1.1rem; font-weight: 600; list-style: none; }
details.fold > summary::before { content: "▸"; display: inline-block; margin-right: .5rem; color: var(--muted); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > .tablewrap { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); margin: 0; }
details:not(.fold) > summary { cursor: pointer; color: var(--accent); }
.structure { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.site { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.site.inactive { opacity: .72; }
.site > header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); }
.site > header h2 { margin: 0; font-size: 1.05rem; }
.site ul { list-style: none; margin: 0; padding: .3rem 0; }
.site li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem 1rem; }
.site li + li { border-top: 1px solid var(--line-2); }
.site footer { padding: .6rem 1rem .9rem; border-top: 1px solid var(--line-2); }
.actions { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; }

/* ---------- Agenten-Leiste in der Kopfzeile ---------- */
.pausebar { display: flex; align-items: center; gap: .5rem; padding: .25rem .4rem .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; }
.pausebar.inpause { background: var(--amber-soft); border-color: #f0d3a5; }
.pausebar select, .pausebar button { height: 30px; font-size: .86rem; }

/* ---------- Erfassung ---------- */
.tab { padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); background: #fff; }
.tab.active { background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent); }
label.outcome { display: inline-flex; align-items: center; gap: .4rem; margin: .2rem .4rem .2rem 0; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; font-weight: 600; cursor: pointer; }
label.outcome:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cpanel { background: transparent; border: 0; padding: 0; margin: .3rem 0 .3rem 1.2rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: .8rem 0; padding: .7rem 1rem; background: var(--surface); }
legend { font-weight: 600; padding: 0 .3rem; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; display: flex; gap: .3rem; overflow-x: auto; padding: .5rem; }
  .brand { padding: .3rem .5rem; }
  .navgroup { display: flex; gap: .2rem; margin: 0; }
  .navgroup > span { display: none; }
  .content { padding: 1rem; }
  .topbar { padding: .5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 900px) { .app { background: none; } }
.row > .grow { flex: 1; min-width: 180px; }

/* ---------- Analyse ---------- */
.periodbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .3rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a { padding: .42rem .75rem; color: var(--text); text-decoration: none; font-size: .88rem; border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: var(--canvas); }
.seg a.on { background: var(--accent); color: var(--on-accent, #fff); font-weight: 600; }
.inline-l { display: inline-flex; gap: .35rem; align-items: center; font-size: .88rem; color: var(--muted); }
.periodnote { margin: .2rem 0 1.1rem; }
.board.kpis { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.board.kpis .tile { display: flex; flex-direction: column; gap: .15rem; }
.board.kpis .tile > span { order: 0; color: var(--muted); font-size: .84rem; }
.board.kpis .tile > b { order: 1; font-size: 1.75rem; }
.board.kpis .tile em { order: 2; font-style: normal; font-size: .8rem; color: var(--muted); }
.board.kpis .tile em small { color: var(--muted); font-size: .76rem; }
.delta { font-weight: 600; white-space: nowrap; }
.delta.up { color: #1d7a46; }
.delta.down { color: #b3261e; }
.delta.flat { color: var(--muted); font-weight: 500; }
.ref { display: block; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.grid2.tight { gap: 1.4rem; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; min-width: 0; }
.grid2 > .card { margin-bottom: 0; }
.card h3 { margin: 0 0 .6rem; font-size: 1rem; }
.card h4 { margin: 0 0 .5rem; font-size: .86rem; color: var(--muted); font-weight: 600; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cardhead h3 { margin: 0; }
.tablewrap.flat { border: 0; border-radius: 0; margin: 0; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--line-2); stroke-width: 1; }
svg.chart .ax { fill: var(--muted); font-size: 11px; font-family: inherit; }
svg.chart .bar { fill: var(--accent); }
svg.chart .hit, svg.chart .hitdot { fill: transparent; }
svg.chart .mark:hover .bar { fill: color-mix(in srgb, var(--accent) 75%, #000); }
svg.chart .mark:hover .hit { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
svg.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
svg.chart .line.s1, .sw.s1 { stroke: var(--accent); background: var(--accent); }
svg.chart .line.s2, .sw.s2 { stroke: #8a9a9e; background: #8a9a9e; stroke-dasharray: 5 4; }
svg.chart .dot { stroke: var(--surface); stroke-width: 2; }
svg.chart .dot.s1 { fill: var(--accent); }
svg.chart .dot.s2 { fill: #8a9a9e; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.legend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .35rem; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: .6rem; margin: .32rem 0; font-size: .88rem; }
.hbar i { display: block; height: 10px; border-radius: 0 4px 4px 0; background: #b9c6c8; width: var(--w); min-width: 2px; }
.hbar i.pos { background: var(--accent); }
.hbar b { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.sortable thead th { cursor: pointer; user-select: none; }
table.sortable thead th[data-dir="desc"]::after { content: " ▼"; }
table.sortable thead th[data-dir="asc"]::after { content: " ▲"; }
td.c-up { color: #1d7a46; }
td.c-down { color: #b3261e; }
#rank td:nth-child(-n+4) { white-space: nowrap; }
#rank { font-size: .87rem; }
#rank th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
#rank th, #rank td { padding-left: .5rem; padding-right: .5rem; }
#rank td a { font-weight: 600; text-decoration: none; color: var(--text); }
#rank td a:hover { color: var(--accent); text-decoration: underline; }
.avatar.big { width: 52px; height: 52px; font-size: 1.15rem; }
.button { display: inline-block; font-weight: 500; white-space: nowrap; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--text); background: var(--surface); }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); margin-top: 0; }
p.big { font-size: 1.5rem; font-weight: 700; margin: 0 0 .6rem; }
p.big small { font-size: .85rem; font-weight: 400; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Wiedervorlagen ---------- */
.t-red { color: var(--red); }
.t-amber { color: var(--amber); }
.grouph { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.cblist { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .45rem; }
.cblist.inset { padding: 0 1rem 1rem; }
.cbrow { display: grid; grid-template-columns: 200px 1fr auto; gap: 1rem; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-s); padding: .6rem .9rem; }
.cbrow.over { border-left-color: var(--red); }
.cbrow small { display: block; color: var(--muted); font-size: .82rem; }
.cbrow.over .when small { color: var(--red); font-weight: 600; }
.cbrow form { margin: 0; }
@media (max-width: 700px) { .cbrow { grid-template-columns: 1fr; } }
.button:hover { border-color: var(--accent); color: var(--accent); }
.tile b.t-red { color: var(--red); } .tile b.t-amber { color: var(--amber); }

/* ---------- Erfassen ---------- */
.capture-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.4rem; align-items: start; }
.capturehead { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.capturehead .plogo { height: 30px; }
.capturehead .pname { font-size: 1rem; }
.capture-title { margin: .4rem 0 .9rem; }
.kdnr { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; margin-bottom: 1rem; max-width: 340px; }
.kdnr input { font-size: 1.15rem; padding: .55rem .7rem; }
.savebar { align-items: center; gap: 1rem; margin-top: 1rem; }
button.big { font-size: 1.05rem; padding: .65rem 1.6rem; }
.quick { display: inline-flex; flex-wrap: wrap; gap: .35rem; margin-left: .6rem; }
.quick button { font-size: .84rem; padding: .3rem .6rem; }
.quick button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.callout { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: .55rem .8rem; border-radius: var(--radius-s); }
.capture-side { position: sticky; top: 1rem; }
.minitiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .6rem .4rem; }
.minitiles b { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.minitiles span { color: var(--muted); font-size: .8rem; }
.more { display: inline-block; margin-top: .8rem; font-size: .88rem; color: var(--accent); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line-2); font-size: .9rem; align-items: center; }
.recent li:first-child { border-top: 0; }
.recent time { color: var(--muted); font-variant-numeric: tabular-nums; }
.recent small { display: block; color: var(--muted); }
.recent small.win { color: #1d7a46; font-weight: 600; }
.recent a { font-size: .82rem; color: var(--accent); }
@media (max-width: 1100px) { .capture-layout { grid-template-columns: 1fr; } .capture-side { position: static; } }

/* ---------- Projekte ---------- */
.projectgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.projectcard { display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--line);
  border-top: 5px solid var(--pc); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--text); text-decoration: none; }
.projectcard:hover { border-color: var(--pc); box-shadow: 0 2px 10px rgba(18, 52, 59, .08); }
.projectcard h2 { margin: 0; font-size: 1.2rem; }
.projectcard p { margin: 0; font-size: .88rem; }
.pc-head { display: flex; align-items: center; gap: .6rem; }
.pc-head img { height: 28px; }
.pc-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--pc); }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .3rem; }
.pc-stats b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.pc-stats span { color: var(--muted); font-size: .78rem; }
.pc-edit { color: var(--pc); font-weight: 600; font-size: .9rem; margin-top: .2rem; }

/* ---------- Projekt einrichten ---------- */
.setup { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
.setup-side { position: sticky; top: 1rem; }
.items { list-style: none; margin: 0; padding: 0; }
.items > li { border-top: 1px solid var(--line-2); }
.items > li:first-child { border-top: 0; }
.items.sub { margin-left: 1.4rem; border-left: 2px solid var(--line-2); padding-left: .7rem; }
.items.sub > li { border-top: 0; }
.itemrow { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .42rem 0; min-height: 2.4rem; }
.itemrow.head { font-size: 1.02rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.itemrow .badge { margin-left: .3rem; }
.block { margin-bottom: 1.2rem; }
.actions { display: inline-flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.sorter button { padding: .1rem .38rem; font-size: .68rem; line-height: 1.4; border-radius: 4px; }
.sorter button + button { margin-left: 2px; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; font-size: .82rem; color: var(--accent); padding: .2rem .45rem; border-radius: 6px; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover, details.menu[open] > summary { background: var(--accent-soft); }
.menupanel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 280px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(18, 52, 59, .15); padding: .8rem; display: grid; gap: .7rem; }
.menupanel form { display: grid; gap: .4rem; margin: 0; }
.addline { margin: .3rem 0 .6rem; }
.addline input { flex: 1; min-width: 200px; }
details.fold.add { margin: .6rem 0 0; }
details.fold.add > summary { font-size: .92rem; color: var(--accent); }
.addform { display: grid; gap: .7rem; padding: 0 1.1rem 1rem; }
.addform form { display: grid; gap: .6rem; }
.stack { display: grid; gap: .8rem; }
.stack label { font-size: .9rem; }
@media (max-width: 1100px) { .setup { grid-template-columns: 1fr; } .setup-side { position: static; } }

/* ---------- Leitstand ---------- */
.cockpit { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; align-items: start; }
.projectlive { border-top: 4px solid var(--pc); }
.projectlive h3 { display: flex; align-items: center; gap: .5rem; }
.projectlive .pc-dot { width: 12px; height: 12px; }
.minitiles.wide { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin: .4rem 0 .8rem; }
.minitiles em { display: block; font-style: normal; font-size: .78rem; margin-top: .15rem; }
.livechart svg.chart .bar { fill: var(--pc); }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.alerts a { display: block; padding: .55rem .7rem; border-radius: var(--radius-s); border-left: 4px solid var(--line); background: var(--canvas); color: var(--text); text-decoration: none; }
.alerts a:hover { background: var(--accent-soft); }
.alerts b { display: block; }
.alerts span { font-size: .85rem; color: var(--muted); }
.al-pool a { border-left-color: var(--red); background: var(--red-soft); }
.al-pause a { border-left-color: var(--amber); }
.al-quote a { border-left-color: #8a9a9e; }
@media (max-width: 1100px) { .cockpit { grid-template-columns: 1fr; } }

/* ---------- Anmeldung ---------- */
.auth { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; min-height: 100vh; }
.auth-brand { background: var(--ink); color: var(--ink-text); padding: 2.5rem 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand .brand { color: var(--nav-strong, #fff); font-size: 1.15rem; }
.auth-claim h2 { color: var(--nav-strong, #fff); font-size: 2.3rem; margin: 0 0 .8rem; letter-spacing: -.01em; }
.auth-claim p { font-size: 1.05rem; line-height: 1.55; max-width: 30rem; margin: 0; }
.auth-brand small { color: var(--ink-text); font-size: .85rem; }
.auth-card button.big { justify-content: center; text-align: center; }
.auth .main { display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-card h1 { margin-bottom: 1.2rem; }
@media (max-width: 800px) { .auth { grid-template-columns: 1fr; } .auth-brand { padding: 1.5rem; } .auth-claim { display: none; } }

/* ---------- Suche & Angebote ---------- */
.searchbar { display: flex; gap: .5rem; margin-bottom: 1.2rem; max-width: 640px; }
.searchbar input { flex: 1; font-size: 1.05rem; padding: .55rem .7rem; }
.offerrow { display: grid; grid-template-columns: 6rem 1fr auto auto; gap: .8rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line-2); }
.st { font-weight: 600; font-size: .86rem; }
.st-open { color: var(--amber); } .st-accepted { color: #1d7a46; } .st-rejected { color: var(--muted); }
details.fold.add.mini { margin: 0 0 .5rem; } details.fold.add.mini > summary { font-size: .82rem; padding: .35rem .8rem; }

/* ---------- Tagesbericht ---------- */
.daytable th.grp, .daytable td.grp { border-left: 1px solid var(--line); }
.daytable th.grp { text-align: center; }
.daytable th.sub { font-weight: 500; font-size: .76rem; }
.daytable td.go, .daytable th.go { font-weight: 700; background: var(--accent-soft); }
.daytable tr.idle td { color: var(--muted); }
.daytable tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- Ampel gegen Zielwerte ---------- */
.daytable td.a-green, td.a-green { background: #e6f4ea; color: #17633a; font-weight: 600; }
.daytable td.a-yellow, td.a-yellow { background: #fff4d6; color: #8a5a00; font-weight: 600; }
.daytable td.a-red, td.a-red { background: #fde8e6; color: #a1231b; font-weight: 600; }
.tile.amp-green { border-top-color: #2e7d4f; } .tile.amp-green b { color: #17633a; }
.tile.amp-yellow { border-top-color: #d39b16; } .tile.amp-yellow b { color: #8a5a00; }
.tile.amp-red { border-top-color: #b3261e; } .tile.amp-red b { color: #a1231b; }

/* ---------- Einstellungen ---------- */
.seg.tabs { margin-bottom: 1rem; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 1rem; align-items: start; }
.settings-grid > .card { margin: 0; }
.formtable td { padding: .3rem .6rem .3rem 0; border: 0; }
label.radio { display: flex; align-items: center; gap: .45rem; font-weight: 400; }
.small-cell { font-size: .82rem; max-width: 26rem; overflow-wrap: anywhere; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.minitiles .amp-green b { color: #17633a; } .minitiles .amp-yellow b { color: #8a5a00; } .minitiles .amp-red b { color: #a1231b; }
.minitiles .amp-green, .minitiles .amp-yellow, .minitiles .amp-red { border-left: 4px solid; padding-left: .5rem; }
.minitiles .amp-green { border-color: #2e7d4f; } .minitiles .amp-yellow { border-color: #d39b16; } .minitiles .amp-red { border-color: #b3261e; }
.rankbadge { display: inline-block; margin: .4rem 0 0; padding: .2rem .7rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; } .rankbadge small { font-weight: 400; color: var(--muted); }
.brand-logo { max-height: 30px; max-width: 46px; object-fit: contain; border-radius: 4px; background: #fff; padding: 2px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { font-size: .7rem; font-weight: 400; opacity: .7; }

.stack > button { justify-self: start; }
.board .tile em { display: block; }

/* ---------- Verlauf je Stunde ---------- */
.foldbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0 1.1rem .6rem; }
.hourtable .hourrow td { font-weight: 600; border-top: 1px solid var(--line); }
.hourtoggle { all: unset; cursor: pointer; display: inline-flex; align-items: baseline; gap: .4rem; font-weight: 700; color: var(--text); }
.hourtoggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hourtoggle small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.hourtoggle .chev { display: inline-block; transition: transform .15s; color: var(--accent); }
.hourtoggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.hourtable .agentrow td { font-size: .88rem; }
.hourtable .agentrow td:first-child { padding-left: 2.2rem; box-shadow: inset 3px 0 0 var(--accent); }
@media (prefers-reduced-motion: reduce) { .hourtoggle .chev { transition: none; } }
.daytable td.money, .daytable th.money { white-space: nowrap; border-left: 1px solid var(--line); }
.commprev { background: #e6f4ea; color: #17633a; padding: .35rem .7rem; border-radius: 999px; font-size: .9rem; }
.colorfield { display: inline-flex; align-items: center; gap: .5rem; }
.colorfield input[type=color] { width: 42px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.preview { display: grid; grid-template-columns: 140px 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 70px; }
.preview .pv-nav { display: grid; place-items: center; font-weight: 600; }
.preview .pv-bg { display: flex; align-items: center; gap: .8rem; padding: .8rem; }
.preview .pv-tab { padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.tile em .delta { display: inline; margin: 0; font-size: inherit; }

/* ---------- KPI-Filter ---------- */
.kpifilter { position: relative; }
.kpipanel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(18, 52, 59, .18); padding: .8rem; }
.kpihead { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.kpilist { display: grid; gap: .3rem; margin-bottom: .6rem; }
.kpilist label { display: flex; gap: .5rem; align-items: center; font-size: .9rem; }
.pagehead .kpifilter { align-self: flex-start; }
.board .tile b { white-space: nowrap; font-size: clamp(1.35rem, 1.9vw, 1.85rem); }

/* Vergleichszeilen in Kennzahl-Kacheln: Tendenz immer rechts in derselben Zeile, nie darunter */
.board.kpis { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); }
.board.kpis .tile em.ref { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; white-space: nowrap; font-size: .78rem; }
.board.kpis .tile em.ref .delta { flex-shrink: 0; }

/* Ranglisten: wenige Calls – Quoten wenig aussagekräftig */
tr.few td { color: var(--muted); }
tr.few td[class*="a-"], tr.few td[class*="c-"] { background: none; color: var(--muted); }
.periodnote.note { color: #8a5a00; }

/* ---------- Tagesziele ---------- */
.goals h4 { margin: .2rem 0 .5rem; font-size: .86rem; color: var(--muted); }
.goal { margin-bottom: .7rem; }
.goalhead { display: flex; justify-content: space-between; font-size: .9rem; }
.goalhead span { font-variant-numeric: tabular-nums; color: var(--muted); }
.goalbar { position: relative; height: 10px; border-radius: 5px; background: var(--line-2); margin: .3rem 0 .2rem; }
.goalbar .now { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--accent); }
.goalbar .fc { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--text); opacity: .55; }
.goal small { font-size: .78rem; color: var(--muted); }
.goal.st-green small { color: #17633a; font-weight: 600; }
.goal.st-yellow small { color: #8a5a00; font-weight: 600; }
.goal.st-red small { color: #a1231b; font-weight: 600; }
.goal.st-green .goalbar .now { background: #2e7d4f; }

/* ---------- Wallboard (Vollbild, Lesbarkeit aus mehreren Metern) ---------- */
body.wallboard { margin: 0; min-height: 100vh; background: var(--nav, #10233d); color: var(--on-nav, #fff); font-size: clamp(16px, 1.25vw, 26px); }
.wb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.4em 2em .6em; flex-wrap: wrap; }
.wb-head h1 { margin: 0; font-size: 2.2em; display: flex; align-items: center; gap: .45em; }
.wb-head h1 i { width: .55em; height: .55em; border-radius: 50%; display: inline-block; }
.wb-head p { margin: 0; opacity: .75; }
.wb-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.2em; padding: 1em 2em 2em; }
.wb-tiles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(12em, 1fr)); gap: 1.2em; }
.wb-tile, .wb-card { background: var(--surface, #fff); color: var(--text); border-radius: 14px; padding: 1em 1.3em; }
.wb-tile span { display: block; color: var(--muted); font-size: .95em; }
.wb-tile b { display: block; font-size: 3.4em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wb-tile small { color: var(--muted); font-size: .85em; }
.wb-card h4, .wb-card .goals h4 { margin: 0 0 .7em; font-size: 1.15em; color: var(--text); }
.wallboard .goal { margin-bottom: 1.1em; }
.wallboard .goalhead { font-size: 1.15em; }
.wallboard .goalbar { height: 18px; border-radius: 9px; }
.wallboard .goalbar .now { border-radius: 9px; }
.wallboard .goal small { font-size: .9em; }
.wb-top { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.wb-top li { counter-increment: r; display: grid; grid-template-columns: 2em 1fr auto; grid-template-rows: auto auto; column-gap: .6em; padding: .5em 0; border-bottom: 1px solid var(--line-2); }
.wb-top li::before { content: counter(r); grid-row: 1 / 3; font-size: 1.6em; font-weight: 700; color: var(--muted); align-self: center; }
.wb-top li span { font-size: 1.25em; font-weight: 600; }
.wb-top li b { grid-row: 1 / 3; grid-column: 3; font-size: 2em; align-self: center; font-variant-numeric: tabular-nums; }
.wb-top li small { color: var(--muted); }
@media (max-width: 900px) { .wb-grid { grid-template-columns: 1fr; } }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .1rem 1rem; max-height: 22rem; overflow: auto; padding: .3rem; border: 1px solid var(--line-2); border-radius: 8px; }
fieldset.choice { border: 0; padding: 0; margin: 0 0 .6rem; display: grid; gap: .4rem; }
fieldset.choice legend { font-weight: 600; margin-bottom: .4rem; }
fieldset.choice label.radio { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line-2); border-radius: 8px; }
fieldset.choice label.radio small { display: block; color: var(--muted); }
fieldset.choice label.radio:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tablewrap table.num td { white-space: nowrap; }
.recent.offers li { grid-template-columns: 1fr auto; }
.recent.offers button.small { padding: .2rem .5rem; }
details.more-calls summary { cursor: pointer; font-size: .85rem; color: var(--accent); margin: .4rem 0; }
.recent small em { font-style: normal; color: #8a5a00; font-weight: 600; }
