/* mh anwälte: Gestaltung nach der Kanzlei-Website (Goldgelb #efbb20, Orange #ff5900, Anthrazit #222, Schrift Open Sans) */
:root { --bg:#f5f4f0; --fg:#2a2a2a; --muted:#6b6a66; --card:#fff; --line:#e3e1da; --field:#c9c7be;
  --brand:#efbb20; --orange:#ff5900; --ink:#222; --accent:#c94300;
  --btn-bg:#222; --btn-fg:#fff; --btn-hover-bg:#efbb20; --btn-hover-fg:#222; --pill-bg:#222; --pill-fg:#efbb20;
  --good:#d7f0de; --tight:#fff1c9; --bad:#fbd9d6; --ok:#d7f0de; --full:#fff1c9; --over:#fbd9d6; --none:#eeede8; }
@media (prefers-color-scheme: dark) { :root { --bg:#161615; --fg:#ecebe7; --muted:#a3a29b; --card:#222221; --line:#383835; --field:#55544f;
  --brand:#efbb20; --orange:#ff7a33; --ink:#f2f1ed; --accent:#efbb20;
  --btn-bg:#efbb20; --btn-fg:#222; --btn-hover-bg:#fff; --btn-hover-fg:#222; --pill-bg:#efbb20; --pill-fg:#222;
  --good:#1f4a2e; --tight:#574a1c; --bad:#5a2623; --ok:#1f4a2e; --full:#574a1c; --over:#5a2623; --none:#2c2c2a; } }
* { box-sizing: border-box; }
::selection { background:var(--brand); color:#222; }
body { margin:0; font:15px/1.5 "Open Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif; background:var(--bg); color:var(--fg); }
a { color:var(--accent); text-underline-offset:2px; }
a:hover { color:var(--orange); }
:where(a, button, input, select, textarea):focus-visible { outline:2px solid var(--brand); outline-offset:2px; }

/* Kopfzeile: weiss, goldene Linie, Wortmarke mh anwälte */
header { background:var(--card); border-bottom:3px solid var(--brand); padding:0 16px; display:flex; gap:16px; align-items:center; flex-wrap:wrap; min-height:54px; }
/* Menue bleibt beim Scrollen oben stehen (ab 900 px Breite; auf schmalen Geraeten braeuchte es zu viel Platz) */
@media (min-width:900px) {
  header { position:sticky; top:0; z-index:40; box-shadow:0 2px 8px rgba(0,0,0,.08); }
  html { scroll-padding-top:calc(var(--header-h, 57px) + 10px); }
  .zside { top:calc(var(--header-h, 57px) + 12px) !important; max-height:calc(100vh - var(--header-h, 57px) - 24px) !important; }
}
header .brand { font-size:1.25rem; font-weight:700; color:var(--ink); text-decoration:none; letter-spacing:-.01em; margin-right:6px; }
header .brand .mh, .wordmark .mh { color:var(--orange); }
header nav { display:flex; gap:2px; flex-wrap:wrap; flex:1; align-self:stretch; align-items:stretch; }
header nav a { display:flex; align-items:center; padding:0 11px; font-size:.9rem; font-weight:600; color:var(--muted); text-decoration:none;
               border-bottom:3px solid transparent; }
header nav a:hover { color:var(--accent); }
header nav a.on { color:var(--ink); border-bottom-color:var(--ink); }
header a { text-decoration:none; }
header a.who { color:var(--muted); font-size:.9rem; }
header a.timer-ind { background:var(--pill-bg); color:var(--pill-fg); border-radius:999px; padding:1px 11px; font-weight:600; font-size:.85rem; }
header form { margin:0; }
.wordmark { margin:0 0 .6rem; font-size:1.7rem; font-weight:700; letter-spacing:-.01em; color:var(--ink); }

main { padding:18px 16px; max-width:1500px; margin:0 auto; }
h1 { font-size:1.45rem; font-weight:600; line-height:1.2; margin:.2rem 0 1.1rem; padding-left:12px; border-left:6px solid var(--brand); color:var(--ink); }
h2 { font-size:1.1rem; margin:1.4rem 0 .5rem; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px 16px; margin-bottom:16px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; margin-bottom:16px; }
.kpi { background:var(--card); border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:8px; padding:10px 14px; }
.kpi b { display:block; font-size:1.4rem; font-weight:600; } .kpi span { color:var(--muted); font-size:.85rem; }
table { border-collapse:collapse; width:100%; background:var(--card); }
th, td { padding:6px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
th { font-size:.8rem; font-weight:600; color:var(--muted); text-transform:none; white-space:nowrap; }
td.n, th.n { text-align:right; font-variant-numeric:tabular-nums; }
.scroll { overflow-x:auto; }
.pill { display:inline-block; padding:1px 9px; border-radius:10px; font-size:.8rem; }
.good,.ok { background:var(--good); } .tight,.full { background:var(--tight); } .bad,.over { background:var(--bad); } .none { background:var(--none); color:var(--muted); }
.cell { min-width:118px; text-align:center; white-space:nowrap; }
.cell small { display:block; color:var(--muted); }
.filter, .grid { display:flex; gap:10px; flex-wrap:wrap; align-items:end; }
form.stack label { display:block; margin:.5rem 0; } form.stack input, form.stack select, form.stack textarea { width:100%; max-width:420px; }
label span { display:block; font-size:.8rem; color:var(--muted); }
input, select, textarea, button { font:inherit; padding:5px 8px; border:1px solid var(--field); border-radius:6px; background:var(--card); color:var(--fg); }
/* Knoepfe wie auf der Kanzlei-Website: runde Schaltflaechen, anthrazit, beim Ueberfahren goldgelb */
button { background:var(--btn-bg); color:var(--btn-fg); border-color:var(--btn-bg); border-radius:999px; padding:6px 16px; font-weight:600; cursor:pointer; }
button:hover { background:var(--btn-hover-bg); border-color:var(--btn-hover-bg); color:var(--btn-hover-fg); }
.bar2 { display:flex; height:12px; background:var(--line); border-radius:6px; overflow:hidden; }
.bar2 i { display:block; height:100%; } .bar2 i.f { background:var(--brand); } .bar2 i.n { background:var(--muted); opacity:.55; }
.tl-letter { position:absolute; right:3px; top:2px; width:17px; height:17px; border-radius:50%; background:var(--warn); color:#fff;
             font-size:.72rem; font-weight:700; font-style:normal; text-align:center; line-height:17px; }
input.big { font-size:1.05rem; padding:8px 10px; min-height:40px; }
/* Zuletzt verwendet: 5 x 2 gleich grosse Kacheln */
.chips { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.chipwrap { display:flex; flex-direction:column; gap:6px; min-width:0; }
.chip { flex:1; display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:2px; padding:8px 10px;
        min-width:0; min-height:98px; background:var(--card); color:inherit; border:1px solid var(--line); border-radius:8px;
        cursor:pointer; font-size:.9rem; font-weight:400; line-height:1.3; }
.chip:hover { background:var(--card); color:inherit; border-color:var(--brand); box-shadow:0 0 0 1px var(--brand); }
.chip .nm { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; word-break:break-word; }
.chip small { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:.78rem; }
.chip small:first-of-type { margin-top:auto; }
.chip small.last { color:var(--fg); }
.aktnav { margin:-.4rem 0 1rem; }
/* Retainer: Ampel der letzten 12 Monate neben der PR-Nummer */
.mon12 { display:inline-flex; gap:2px; vertical-align:middle; margin-left:7px; }
.mon12 i { display:block; width:6px; height:13px; border-radius:2px; background:var(--line); }
.mon12 .m-gruen { background:var(--eu-gruen); } .mon12 .m-gelb { background:var(--eu-gelb); } .mon12 .m-rot { background:var(--ampel-rot); }
.prrow { display:flex; align-items:center; flex-wrap:wrap; max-width:100%; }
.tile-main a.big { color:inherit; text-decoration:underline dotted; }
/* Auswertung: Aktennummer nach Status */
.pr-laufend, a.pr-laufend { color:var(--eu-gruen); font-weight:600; } .pr-erledigt, a.pr-erledigt { color:var(--ampel-rot); font-weight:600; }
/* Akte: Auswertung als Kacheln */
.akttiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin-bottom:16px; }
.akttiles .tile-main { flex-wrap:wrap; } .akttiles .tile-link { display:inline-block; margin-top:8px; font-size:.85rem; }
@media (max-width:760px) { .chips { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:480px) { .chips { grid-template-columns:repeat(2,minmax(0,1fr)); } }
:root { --eu-gruen:#2e9a4f; --eu-gelb:#e0a100; --ampel-rot:#d63c32; }
@media (prefers-color-scheme: dark) { :root { --eu-gruen:#4cc27a; --eu-gelb:#f2c230; --ampel-rot:#e5584e; } }
/* Budgetverbrauch-Ampel an den Kacheln: Balken und Prozent, gruen bis 50 %, gelb bis 70 %, darueber rot */
.bud { display:flex; align-items:center; gap:6px; width:100%; margin-top:2px; }
.bud .track { flex:1; height:6px; background:var(--line); border-radius:3px; overflow:hidden; }
.bud .track i { display:block; height:100%; }
.bud em { font-style:normal; font-size:.74rem; color:var(--muted); white-space:nowrap; }
.bud-gruen .track i { background:var(--eu-gruen); } .bud-gelb .track i { background:var(--eu-gelb); } .bud-rot .track i { background:var(--ampel-rot); }
.bud-rot em { color:var(--ampel-rot); font-weight:600; }
.chipbtns { display:flex; gap:6px; margin:0; }
.chiplinks { font-size:.78rem; color:var(--muted); }
#schnellwahl { font-size:.9rem; align-self:center; } #schnellwahl a.on { font-weight:700; color:var(--ink); text-decoration:none; }
.chipgo { flex:1; display:flex; align-items:center; justify-content:center; padding:3px 0; background:var(--card); color:var(--accent);
          border:1px solid currentColor; border-radius:6px; cursor:pointer; }
.chipgo svg { width:18px; height:18px; display:block; }
.chipgo.gruen { color:var(--eu-gruen); } .chipgo.gelb { color:var(--eu-gelb); }
.chipgo:hover { background:var(--none); }
.pausebox { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:0 0 10px; padding:8px 12px;
            background:var(--tight); border:1px solid var(--eu-gelb); border-radius:6px; }
.pausebox > span { flex:1 1 320px; }
header a.pausing { background:var(--tight); border:1px solid var(--eu-gelb); border-radius:10px; padding:1px 9px; color:var(--fg); font-weight:600; }
button.link { background:none; color:var(--accent); border:0; padding:0; border-radius:0; font-weight:400; }
button.link:hover { background:none; color:var(--orange); }
.flash { padding:8px 12px; border-radius:6px; margin-bottom:12px; background:var(--good); } .flash.error { background:var(--bad); }
.muted { color:var(--muted); } .note { color:var(--muted); font-size:.85rem; }
.login { max-width:360px; margin:10vh auto; }

/* Zeitstrahl (Tagesansicht): Balken neutral, Farbe nur fuer Hinweise (Luecke rot, Ueberschneidung orange, Pause gruen) */
:root { --gap:rgba(220,60,50,.28); --gapline:#d63c32; --ov:rgba(245,150,20,.38); --warn:#e8900c;
  --bar:#ebe9e2; --barline:#8d8a80; --int:#fbfaf7; --intline:#b4b1a6; --shade:rgba(120,118,110,.12); }
@media (prefers-color-scheme: dark) { :root { --gap:rgba(230,80,70,.32); --gapline:#e5584e; --ov:rgba(245,160,40,.4);
  --bar:#3b3a36; --barline:#8d8a80; --int:#2a2a28; --intline:#6f6d66; --shade:rgba(220,218,210,.07); } }
.tl { position:relative; margin:0 6px; }
.tl-axis { position:relative; height:20px; font-size:.75rem; color:var(--muted); }
.tl-axis span { position:absolute; transform:translateX(-50%); white-space:nowrap; }
.tl-body { position:relative; border:1px solid var(--line); border-radius:6px; background:var(--card); overflow:hidden; }
.tl-grid { position:absolute; top:0; bottom:0; width:1px; background:var(--line); }
.tl-shade { position:absolute; top:0; bottom:0; background:var(--shade); }
.tl-presence { position:absolute; top:0; bottom:0; background:rgba(60,140,90,.13); border-left:2px solid rgba(60,140,90,.75);
               border-right:2px solid rgba(60,140,90,.75); box-sizing:border-box; pointer-events:none; }
.tl-presence span { position:absolute; left:6px; bottom:1px; font-size:.7rem; color:rgba(40,110,70,1); white-space:nowrap; }
.tl-bar.pause, .tl-bar.privat { background:repeating-linear-gradient(135deg, rgba(60,140,90,.16) 0 6px, rgba(60,140,90,.06) 6px 12px);
  border:1px dashed rgba(60,140,90,.8); color:inherit; }
.tl-bar.privat { background:repeating-linear-gradient(135deg, rgba(150,110,40,.18) 0 6px, rgba(150,110,40,.06) 6px 12px); border-color:rgba(150,110,40,.85); }
.lg-pause { background:rgba(60,140,90,.18); border:1px dashed rgba(60,140,90,.8); }
tr.absence td { background:rgba(60,140,90,.06); }
.lg-pres { background:rgba(60,140,90,.25); border:1px solid rgba(60,140,90,.75); }
@media (prefers-color-scheme: dark) { .tl-presence span { color:#8fd3a8; } }
.tl-gap { min-width:12px; position:absolute; top:0; bottom:0; background:var(--gap); border-left:2px solid var(--gapline); border-right:2px solid var(--gapline);
  display:flex; align-items:center; justify-content:center; color:var(--gapline); font-size:.75rem; text-decoration:none; overflow:hidden; z-index:1; }
.tl-gap { cursor:copy; }
.tl-gap:hover { background:var(--gapline); color:#fff; }
.tl-bar { position:absolute; height:30px; background:var(--bar); border:1px solid var(--barline); border-radius:4px; padding:0 5px;
  font-size:.78rem; line-height:28px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--fg); text-decoration:none; z-index:2; box-sizing:border-box; }
.tl-bar.intern { background:var(--int); border-color:var(--intline); border-style:dashed; }
.tl-bar.cont { border-right:3px dashed var(--barline); }
a.tl-bar:hover { filter:brightness(.95); outline:2px solid var(--brand); }
.tl-ov { position:absolute; top:0; bottom:0; background:var(--ov); border-left:2px solid var(--warn); border-right:2px solid var(--warn); z-index:3; cursor:pointer; text-decoration:none; }
.tl-ov { min-width:18px; margin-left:-7px; box-sizing:border-box; }
.tl-ov:hover { outline:2px solid var(--warn); }
.tl-ovpill { position:absolute; top:1px; left:2px; background:var(--warn); color:#fff; font-size:.75rem; padding:1px 7px; border-radius:8px; white-space:nowrap; }
.tl-hint { position:absolute; top:0; z-index:5; color:var(--accent); transform:translateX(-50%); }
.pill.tl-green { background:var(--good); } .pill.tl-yellow { background:var(--tight); } .pill.tl-red { background:var(--bad); }
.pill.tl-unsure, .pill.tl-free { background:var(--none); color:var(--muted); }
.lg { display:inline-block; width:14px; height:10px; margin:0 4px 0 12px; border-radius:2px; vertical-align:middle; }
.lg-bar { background:var(--bar); border:1px solid var(--barline); } .lg-int { background:var(--int); border:1px dashed var(--intline); }
.lg-gap { background:var(--gap); border:1px solid var(--gapline); } .lg-ov { background:var(--ov); border:1px solid var(--warn); }

/* Auswahl bei Ueberschneidungen: ein Klick je Loesung */
.choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:8px; margin-top:8px; }
.choices form { margin:0; }
button.choice { width:100%; height:100%; text-align:left; background:var(--card); color:var(--fg); border:1px solid var(--line);
  border-radius:8px; padding:8px 10px; display:flex; flex-direction:column; gap:2px; cursor:pointer; font-weight:600; }
button.choice span { font-size:.8rem; color:var(--muted); font-weight:normal; }
button.choice:hover:not([disabled]) { border-color:var(--brand); background:var(--none); color:var(--fg); }
button.choice[disabled] { opacity:.45; cursor:not-allowed; }

/* Erlaeuterungen als Mouseover: gepunktet unterstrichen, Fragezeichen-Zeiger */
.help { cursor:help; border-bottom:1px dotted var(--muted); }
label span.help { display:block; width:fit-content; }
.defs { display:grid; grid-template-columns:max-content 1fr; gap:4px 14px; margin:.6rem 0; }
.defs dt { font-weight:600; } .defs dd { margin:0; }

/* RVG-Rechner */
.rvgcases { display:flex; flex-wrap:wrap; gap:8px 32px; margin-top:.8rem; }
.case { display:flex; flex-direction:column; gap:4px; }
.chk { display:flex; align-items:center; gap:6px; cursor:pointer; }
.chk.sub { margin-left:24px; font-size:.9rem; }
.chk input { width:auto; padding:0; accent-color:var(--brand); }

/* Zeiterfassung, oberste Zeile: Letzte Aenderung (1/6) und Zeitstrahl des Tages (5/6) */
.daynav { align-items:center; margin-bottom:12px; }
.daynav .daystep { font-size:1.4rem; line-height:1; text-decoration:none; padding:4px 6px; }
.daynav .daystep.off { opacity:.3; }
.daynav .daynote { flex:1 1 320px; font-size:.85rem; }
.toprow { display:grid; grid-template-columns:1fr 5fr; gap:12px; align-items:stretch; margin-bottom:16px; }
.toprow .card { margin-bottom:0; min-width:0; }
.lastchange { display:flex; flex-direction:column; gap:6px; font-size:.85rem; }
.lastchange form { display:flex; flex-direction:column; gap:6px; align-items:flex-start; margin:0; }
.lastchange button { padding:3px 12px; }
.tl-title { display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-size:.85rem; margin-bottom:2px; }
@media (max-width:900px) { .toprow { grid-template-columns:1fr; } }

/* Zeiterfassung: Hauptspalte links, Soll/Ist als Kacheln am rechten Rand */
.zlayout { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:18px; align-items:start; }
.zmain { min-width:0; }
.zside { position:sticky; top:12px; display:grid; gap:10px; max-height:calc(100vh - 24px); overflow-y:auto; }
.zside-h { margin:0; font-size:.95rem; }
.tile { background:var(--card); border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:8px; padding:10px 12px; }
.tile-head { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.tile-main { display:flex; align-items:baseline; gap:8px; margin:2px 0 6px; }
.tile-main .big { font-size:1.5rem; font-weight:600; line-height:1.2; }
.tile-main .pct { color:var(--muted); font-weight:600; }
.tile-stats { display:grid; gap:2px; margin:8px 0 0; font-size:.85rem; }
.tile-stats div { display:flex; justify-content:space-between; gap:8px; }
.tile-stats dt { color:var(--muted); }
.tile-stats dd { margin:0; font-variant-numeric:tabular-nums; }
@media (max-width:1100px) {
  .zlayout { grid-template-columns:1fr; }
  .zside { position:static; max-height:none; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); }
  .zside .zside-h, .zside .note { grid-column:1 / -1; }
}

/* Mitarbeiterauswertung: Leistungszeit nach Budgetbereich */
.zonebar { display:flex; height:14px; min-width:160px; background:var(--line); border-radius:7px; overflow:hidden; }
.zonebar i { display:block; height:100%; }
.z-gruen { background:var(--eu-gruen); } .z-gelb { background:var(--eu-gelb); } .z-rot { background:var(--ampel-rot); }
.z-ue100 { background:#8e1b14; } .z-ue120 { background:#3d0a07; } .z-ohne { background:var(--muted); opacity:.35; }
.zonekey i { display:inline-block; width:12px; height:12px; border-radius:3px; vertical-align:-1px; margin:0 4px 0 10px; }
.pill.w-rot { background:var(--ampel-rot); color:#fff; } .pill.w-ue100 { background:#8e1b14; color:#fff; } .pill.w-ue120 { background:#3d0a07; color:#fff; }
.warncard { border-left:4px solid var(--ampel-rot); }

/* Eieruhr: Knoepfe Pause und Privat */
.pausetext { flex:1 1 260px; } .pausetext input { width:100%; }
a.mslogin { display:block; text-align:center; padding:.6rem 1rem; border-radius:8px; background:var(--ink); color:#fff; font-weight:600; text-decoration:none; }
a.mslogin:hover { background:var(--accent); }
.umbruch { display:flex; flex-wrap:wrap; gap:8px; align-items:end; margin:.6rem 0 0; }
.umbruch .note { margin:0; flex:1 1 280px; }
.awaybtns { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:.6rem; }
.awaybtns button.away { background:var(--card); color:var(--fg); border:1px solid var(--eu-gelb); }
.awaybtns button.away:hover { background:var(--tight); }

/* Hinweis auf eine neue Programmversion (static/update.js) */
.updatebar { position:sticky; top:0; z-index:50; display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:center;
             padding:8px 14px; background:var(--tight); border-bottom:2px solid var(--eu-gelb); color:var(--fg); }

/* Zeitstrahl: freie Stelle anklickbar (static/zeitstrahl.js) */
.tl-body.tl-free { cursor:copy; }
td.best { font-weight:700; }
