/* Vorbild: Jira Listenansicht (Mobbin f5765278), dichte Tabelle mit Zellrahmen, alles klickbar */
:root {
  --grund: #ffffff;
  --text: #172b4d;
  --leise: #505f79;
  --blass: #8590a2;
  --linie: #dfe1e6;
  --linie-hell: #ebecf0;
  --hover: #f4f5f7;
  --gewaehlt: #e9f2ff;
  --akzent: #0c66e4;
  --akzent-dunkel: #0055cc;
  --marke: #0b3b73;
  --l-gruen: #dcfff1; --l-gruen-t: #216e4e;
  --l-gelb: #fff7d6; --l-gelb-t: #7f5f01;
  --l-grau: #dcdfe4; --l-grau-t: #44546f;
  --l-blau: #e9f2ff; --l-blau-t: #0055cc;
  --l-lila: #f3f0ff; --l-lila-t: #5e4db2;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--grund); color: var(--text); font-size: 13px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 16px; height: 16px; flex: none; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Kopfleiste */
.oben { display: flex; align-items: center; gap: 16px; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--linie); position: sticky; top: env(safe-area-inset-top, 0px); background: #fff; z-index: 20; }
.marke { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; min-width: 180px; }
.logo { width: 24px; height: 24px; border-radius: 6px; background: var(--marke); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.suche-oben { flex: 1; max-width: 720px; display: flex; align-items: center; gap: 8px; border: 1px solid #8590a2; border-radius: 4px; height: 32px; padding: 0 10px; color: var(--leise); }
.suche-oben:focus-within { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent); }
.suche-oben input { border: 0; outline: 0; flex: 1; font: inherit; font-size: 14px; color: var(--text); background: none; }
.oben-rechts { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--blass); font-size: 12px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #5e4db2; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.link { background: none; border: 0; color: var(--leise); padding: 0; font-size: 12px; }
.link:hover { color: var(--text); text-decoration: underline; }

/* Hauptbereich mit Detailfeld rechts */
.haupt { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 48px); }
.haupt.mit-detail { grid-template-columns: minmax(0, 1fr) 480px; }
.inhalt { padding: 16px 24px 110px; min-width: 0; }
.brot { color: var(--leise); font-size: 14px; }
.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 8px; }
h1 { font-size: 17px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.titel-icon { width: 24px; height: 24px; border-radius: 4px; background: linear-gradient(135deg, #0c66e4, #0b3b73); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.summen { display: flex; gap: 20px; font-size: 12px; color: var(--leise); }
.summen button { border: 0; background: none; padding: 2px 4px; border-radius: 3px; text-align: right; }
.summen button:hover { background: var(--hover); }
.summen b { display: block; font-size: 15px; color: var(--text); font-weight: 600; }

.reiter { display: flex; gap: 16px; border-bottom: 2px solid var(--linie-hell); margin-bottom: 14px; }
.reiter button { border: 0; background: none; padding: 6px 2px; margin-bottom: -2px; border-bottom: 2px solid transparent; color: var(--leise); font-weight: 500; }
.reiter button:hover { color: var(--text); }
.reiter button.an { color: var(--akzent); border-bottom-color: var(--akzent); }
.reiter button span { color: var(--blass); font-weight: 400; margin-left: 2px; }

.werkzeugleiste { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.leer-flex { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--linie); background: #fff; border-radius: 4px; font-size: 13px; font-weight: 500; color: var(--leise); white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.btn.an { background: var(--gewaehlt); border-color: #85b8ff; color: var(--akzent-dunkel); }
.btn.icon { padding: 0 8px; }
.btn.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.btn.primaer:hover { background: var(--akzent-dunkel); }
.btn.klein { height: 28px; font-size: 13px; padding: 0 8px; }
.zaehler { background: var(--akzent); color: #fff; border-radius: 8px; font-size: 11px; padding: 0 6px; line-height: 16px; }
.filter-wrap { position: relative; }

/* Menues */
.menue { position: absolute; z-index: 40; background: #fff; border-radius: 4px; box-shadow: 0 8px 12px rgba(9, 30, 66, .15), 0 0 1px rgba(9, 30, 66, .31); padding: 6px 0; min-width: 220px; }
#filter-menue { top: 36px; left: 0; }
.menue button, .menue a { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 14px; text-align: left; font-size: 14px; color: var(--text); }
.menue button:hover, .menue a:hover { background: var(--hover); text-decoration: none; }
.menue .trenner { height: 1px; background: var(--linie-hell); margin: 6px 0; }
.menue .kopf { font-size: 11px; font-weight: 600; color: var(--leise); text-transform: uppercase; padding: 6px 14px 4px; letter-spacing: .03em; }
.kasten { width: 16px; height: 16px; border: 2px solid #8590a2; border-radius: 3px; display: grid; place-items: center; flex: none; }
.kasten.an { background: var(--akzent); border-color: var(--akzent); }
.kasten.an::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* Tabelle mit Zellrahmen */
.tabelle-rahmen { border: 1px solid var(--linie); border-radius: 4px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--leise); height: 38px; padding: 0 10px; border-bottom: 1px solid var(--linie); border-right: 1px solid var(--linie-hell); white-space: nowrap; background: #fff; user-select: none; }
th.sortierbar { cursor: pointer; }
th.sortierbar:hover { background: var(--hover); }
th .pfeil { color: var(--leise); margin-left: 4px; font-size: 11px; }
td { height: 36px; padding: 3px 10px; border-bottom: 1px solid var(--linie-hell); border-right: 1px solid var(--linie-hell); white-space: nowrap; vertical-align: middle; }
th:last-child, td:last-child { border-right: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--hover); }
tbody tr.offen-im-detail td { background: var(--gewaehlt); }
tbody tr.vorgeschlagen td:first-child { box-shadow: inset 2px 0 0 var(--akzent); }
td.r, th.r { text-align: right; }
td.mitte, th.mitte { text-align: center; width: 44px; padding: 0; }
td.objekt { white-space: normal; min-width: 220px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
td.objekt .zweizeilig { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj { font-weight: 600; margin-right: 6px; }
.leise { color: var(--blass); }
.plus { color: var(--l-gruen-t); }
tfoot td { height: 40px; color: var(--leise); font-size: 13px; border-bottom: 0; background: #fff; cursor: default; }
tfoot td b { color: var(--text); }
.leer { padding: 40px 16px; text-align: center; color: var(--leise); }

.haken { width: 16px; height: 16px; border: 2px solid #8590a2; border-radius: 3px; background: #fff; display: inline-grid; place-items: center; padding: 0; vertical-align: middle; }
.haken:hover { border-color: var(--akzent); }
.haken.an { background: var(--akzent); border-color: var(--akzent); }
.haken.an::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* Status wie Jira-Lozenge, mit Auswahlpfeil */
.lozenge { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 4px 0 6px; border-radius: 3px; border: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; }
.lozenge::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translate(-1px, -1px); margin: 0 3px 0 3px; }
.lozenge.ohne::after { display: none; }
.lozenge:hover { filter: brightness(.95); }
.s-zahlbar { background: var(--l-gruen); color: var(--l-gruen-t); }
.s-kunde_offen { background: var(--l-gelb); color: var(--l-gelb-t); }
.s-nicht_weiterberechnet { background: var(--l-grau); color: var(--l-grau-t); }
.s-teilweise { background: var(--l-gelb); color: var(--l-gelb-t); }
.s-bezahlt { background: var(--l-blau); color: var(--l-blau-t); }
.s-vorschlag { background: var(--l-lila); color: var(--l-lila-t); }

.punkte { width: 28px; height: 28px; border: 0; border-radius: 3px; background: none; color: var(--leise); font-size: 16px; line-height: 1; }
.punkte:hover { background: #dcdfe4; }

.legende { color: var(--blass); font-size: 12px; margin-top: 12px; }

/* Detailfeld rechts */
.detail { border-left: 1px solid var(--linie); background: #fff; position: sticky; top: 48px; height: calc(100vh - 48px); overflow-y: auto; padding: 16px 20px 100px; }
.d-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d-kopf .leise { font-size: 12px; }
.d-schliessen { border: 0; background: none; width: 32px; height: 32px; border-radius: 4px; font-size: 18px; color: var(--leise); }
.d-schliessen:hover { background: var(--hover); }
.detail h2 { font-size: 17px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -.01em; }
.d-objekt { color: var(--leise); margin-bottom: 12px; }
.d-aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.d-abschnitt { border: 1px solid var(--linie); border-radius: 4px; margin-bottom: 12px; }
.d-abschnitt h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--leise); padding: 8px 12px; border-bottom: 1px solid var(--linie-hell); }
.d-felder { display: grid; grid-template-columns: 140px 1fr; gap: 0; }
.d-felder div { padding: 7px 12px; border-bottom: 1px solid var(--linie-hell); }
.d-felder div:nth-last-child(-n+2) { border-bottom: 0; }
.d-felder .feld { color: var(--leise); font-size: 13px; }
.d-notiz { padding: 10px 12px; font-size: 13px; color: var(--leise); }
.d-vorschau { width: 100%; height: 560px; border: 0; display: block; border-top: 1px solid var(--linie-hell); }
.d-reiter { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--linie-hell); }
.d-reiter button { border: 0; background: none; padding: 4px 8px; border-radius: 3px; font-size: 13px; color: var(--leise); }
.d-reiter button.an { background: var(--gewaehlt); color: var(--akzent-dunkel); font-weight: 500; }
.d-protokoll { padding: 6px 12px 10px; font-size: 12px; color: var(--leise); }
.d-protokoll div { padding: 3px 0; }
.datum-feld { display: inline-flex; gap: 6px; align-items: center; }
.datum-feld input { font: inherit; font-size: 14px; height: 32px; border: 1px solid #8590a2; border-radius: 4px; padding: 0 8px; }

/* Leiste unten */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 24px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--linie); box-shadow: 0 -4px 12px rgba(9, 30, 66, .06); }
.leiste-innen { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.leiste-summe { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.leiste-summe span { color: var(--leise); }
.leiste-summe strong { font-size: 16px; }
.ueberweisung { margin-top: 10px; display: grid; gap: 6px; }
.ue-posten { display: grid; grid-template-columns: 2fr 1.6fr .8fr 1fr; gap: 2px 20px; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 4px; }
.ue-posten small { display: block; font-size: 11px; color: var(--leise); font-weight: 600; }
.kopieren { border: 0; background: none; color: var(--akzent); font-size: 12px; padding: 0 0 0 6px; }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #f7f8f9; }
.login-karte { width: 100%; max-width: 360px; background: #fff; border-radius: 4px; padding: 32px; box-shadow: 0 0 10px rgba(9, 30, 66, .1); display: grid; gap: 12px; }
.login-karte h1 { font-size: 17px; margin-bottom: 8px; }
.login-karte input { font: inherit; height: 40px; border: 2px solid var(--linie); border-radius: 3px; padding: 0 10px; }
.login-karte input:focus { outline: 0; border-color: var(--akzent); }
.login-karte .btn { height: 40px; justify-content: center; }
.fehler { color: #ae2a19; font-size: 13px; }

@media (max-width: 1100px) {
  .haupt.mit-detail { grid-template-columns: 1fr; }
  .detail { position: fixed; inset: 48px 0 0 auto; width: min(480px, 100vw); z-index: 25; box-shadow: -8px 0 24px rgba(9, 30, 66, .15); }
}
@media (max-width: 900px) {
  .breit { display: none; }
  td.objekt { min-width: 150px; }
}
@media (max-width: 720px) {
  .oben { gap: 8px; padding: 0 10px; }
  .suche-oben input { font-size: 16px; }
  td, th { padding-left: 6px; padding-right: 6px; }
  td.objekt { min-width: 120px; font-size: 13px; }
  .lozenge { font-size: 10px; }
  .werkzeugleiste .btn { padding: 0 8px; }
  .detail { inset: 48px 0 0 0; width: 100vw; }
  .marke { min-width: 0; }
  .marke span:last-child, .stand { display: none; }
  .inhalt { padding: 12px 12px 110px; }
  .summen { width: 100%; justify-content: space-between; }
  .ue-posten { grid-template-columns: 1fr 1fr; }
}

/* Stunden je Projekt im Detailfeld: eine Zeile je Projekt, Einzelzeilen aufklappbar */
.d-auf { width: 100%; border-collapse: collapse; font-size: 12px; }
.d-auf td { height: 32px; padding: 4px 12px; border-right: 0; white-space: normal; }
.d-auf tr.gruppe { cursor: pointer; }
.d-auf tr.gruppe:hover td { background: var(--hover); }
.d-auf tr.einzel td { height: auto; padding: 3px 12px 3px 30px; color: var(--leise); border-bottom: 0; background: #fafbfc; }
.d-auf tr.einzel:hover td { background: #fafbfc; }
.d-auf .pfeil-k { color: var(--blass); display: inline-block; width: 10px; }
.d-auf .summe td { font-weight: 600; border-top: 1px solid var(--linie); border-bottom: 0; cursor: default; }
.d-auf .summe:hover td { background: none; }
.d-probe { font-size: 11px; color: var(--l-gruen-t); padding: 0 12px 8px; }
.d-probe.falsch { color: #ae2a19; }
