/* Saltcity – Farben nach Jacky: Flächen #9F7A6F, Hintergrund #FDEEDE, Schrift #4B1B1B
   Layout: Mitglieder-App als schmale Handy-Spalte, Team-Portal mit Seitenleiste. */
:root {
  --bg: #FDEEDE; --rose: #9F7A6F; --ink: #4B1B1B;
  --card: #FFF8F1; --rose-soft: #EBD3C6; --rose-line: rgba(75, 27, 27, .14); --muted: #7B5A52;
  --ok: #3E6B4C; --ok-bg: #E2EEDF; --warn: #9A5B16; --warn-bg: #F8E5C8; --bad: #A0342F; --bad-bg: #F6D9D4; --gold: #B7893A;
  --c1: #A8434A; --c2: #C08A2E;
  --display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --r: 14px; --r-sm: 9px; --shadow: 0 1px 2px rgba(75, 27, 27, .06), 0 6px 20px rgba(75, 27, 27, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: .005em; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: 2.2rem; } h2 { font-size: 1.7rem; } h3 { font-size: 1.35rem; }
h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; margin: 1.4em 0 .5em; color: var(--muted); font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: var(--ink); text-underline-offset: 2px; }
small, .small { font-size: .85rem; } .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 0; border-radius: 999px; padding: .62em 1.2em; background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px; transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.rose { background: var(--rose); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rose-line); }
.btn.soft { background: var(--rose-soft); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.sm { padding: .35em .85em; min-height: 32px; font-size: .88rem; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-weight: 500; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack { display: grid; gap: .8rem; } .stack.tight { gap: .45rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.grid2.wide { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.tbl select { min-width: 150px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; }

/* Karten, Chips, Hinweise */
.card { background: var(--card); border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.card.rose { background: var(--rose); color: var(--ink); box-shadow: none; }
.card.flat { box-shadow: none; border: 1px solid var(--rose-line); }
.card h3 { margin-bottom: .3em; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .15em .65em; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--rose-soft); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.ink { background: var(--ink); color: var(--bg); } .chip.line { background: transparent; box-shadow: inset 0 0 0 1px var(--rose-line); }
.note { border-radius: var(--r-sm); padding: .7rem .85rem; background: var(--rose-soft); font-size: .92rem; }
.note.ok { background: var(--ok-bg); color: var(--ok); } .note.warn { background: var(--warn-bg); color: var(--warn); } .note.bad { background: var(--bad-bg); color: var(--bad); }
.divider { height: 1px; background: var(--rose-line); margin: .8rem 0; border: 0; }
.empty { text-align: center; padding: 1.6rem 1rem; color: var(--muted); }

/* Formulare */
label.f { display: grid; gap: .25rem; font-size: .88rem; font-weight: 600; }
label.f > span.h { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=time], input[type=month], select, textarea {
  width: 100%; border: 1.5px solid var(--rose-line); background: #fff; border-radius: 10px; padding: .6em .75em; min-height: 44px; font-weight: 400; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--rose); outline: none; box-shadow: 0 0 0 3px rgba(159, 122, 111, .25); }
.f.err input, .f.err select, .f.err textarea { border-color: var(--bad); }
.av.pic { padding: 0; overflow: hidden; background: var(--rose-soft); }
.av.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prof-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.prof-head .av { width: 84px; height: 84px; font-size: 2.2rem; flex: none; }
.prof-head h2 { margin: 0; }
.prof-head .row { margin-top: .4rem; }
.hello-row { display: flex; align-items: center; gap: .8rem; }
.hello-row .av { width: 48px; height: 48px; font-size: 1.3rem; flex: none; }
.dmy { display: flex; align-items: center; gap: .35rem; }
.dmy input { width: 3.6em !important; text-align: center; padding-left: .3em !important; padding-right: .3em !important; }
.dmy input.y { width: 5.2em !important; }
.dmy span { color: var(--muted); font-weight: 700; }
.dmy.bad input, .f.err .dmy input { border-color: var(--bad); }
.ferr { color: var(--bad); font-size: .82rem; font-weight: 500; }
.fok { color: var(--ok); font-size: .82rem; font-weight: 500; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; cursor: pointer; padding: .5rem 0; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ink); }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .85rem; border-radius: 12px; border: 1.5px solid var(--rose-line); background: #fff; cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: .1rem 0 0; accent-color: var(--ink); flex: none; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--card); }
.choice b { display: block; } .choice small { color: var(--muted); }
.seg { display: inline-flex; background: var(--rose-soft); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: .38em .9em; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); }

/* Tabellen */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: .55rem .6rem; border-bottom: 1.5px solid var(--rose-line); white-space: nowrap; background: var(--card); position: sticky; top: 0; }
.tbl td { padding: .55rem .6rem; border-bottom: 1px solid var(--rose-line); vertical-align: top; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: rgba(159, 122, 111, .08); }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }

/* Modal + Toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(43, 18, 18, .42); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; }
.modal { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 1.4rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom, 0px)); position: relative; }
.modal.wide { max-width: 900px; }
.modal .x { position: absolute; top: .6rem; right: .7rem; border: 0; background: var(--rose-soft); width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; line-height: 1; }
@media (min-width: 700px) { .modal-wrap { align-items: center; padding: 1rem; } .modal { border-radius: 20px; } }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; font-weight: 500; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: min(92vw, 480px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } .toast.err { background: var(--bad); color: #fff; }

/* Demo-Leiste */
.demo-bar { background: var(--ink); color: var(--bg); font-size: .8rem; padding: .35rem max(16px, env(safe-area-inset-left, 0px)); display: flex; gap: .6rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.demo-bar button { background: transparent; color: var(--bg); border: 1px solid rgba(253, 238, 222, .4); border-radius: 999px; padding: .1rem .6rem; cursor: pointer; font-size: .78rem; }

/* ===================== Mitglieder-App ===================== */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.top { background: var(--rose); padding: 1rem max(16px, env(safe-area-inset-right, 0px)) 1.1rem max(16px, env(safe-area-inset-left, 0px)); border-radius: 0 0 24px 24px; }
.top .brand { display: flex; align-items: center; gap: .6rem; }
.top .logo { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--ink); flex: none; }
.top .name { font-family: var(--display); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.top .sub { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.top .bell { margin-left: auto; position: relative; background: rgba(253, 238, 222, .55); border: 0; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.top .bell i { position: absolute; top: 4px; right: 4px; background: var(--ink); color: var(--bg); font-style: normal; font-size: .66rem; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; padding: 0 4px; }
.main { padding: 1rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 1rem; }
.hello { font-family: var(--display); font-size: 1.9rem; font-weight: 600; line-height: 1.1; margin: .5rem 0 .1rem; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--rose-line); display: flex; justify-content: center; z-index: 30; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tabbar .in { display: flex; width: 100%; max-width: 560px; justify-content: space-around; }
.tabbar button { border: 0; background: transparent; display: grid; justify-items: center; gap: 2px; padding: 5px 8px; border-radius: 12px; font-size: .7rem; font-weight: 600; color: var(--muted); cursor: pointer; min-width: 58px; }
.tabbar button svg { width: 23px; height: 23px; }
.tabbar button.on { color: var(--ink); background: var(--rose-soft); }
.hero { background: var(--rose); border-radius: 22px; padding: 1.3rem 1.2rem; position: relative; overflow: hidden; }
.hero h1 { font-size: 2.3rem; margin-bottom: .2em; }
.hero p { max-width: 34ch; }
.hero .lily { position: absolute; right: -24px; bottom: -30px; width: 150px; opacity: .22; pointer-events: none; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; }
.pt { background: var(--bg); border-radius: 12px; padding: .65rem .75rem; }
.pt b { font-family: var(--display); font-size: 2rem; line-height: 1; display: block; }
.pt span { font-size: .78rem; color: var(--muted); }
.dots { display: flex; gap: 5px; margin-top: 5px; } .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); } .dots i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rose); }
.week { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.week button { flex: 1 0 44px; border: 0; background: var(--card); border-radius: 12px; padding: .4rem 0; cursor: pointer; display: grid; justify-items: center; font-size: .72rem; color: var(--muted); font-weight: 600; }
.week button b { font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.week button.on { background: var(--ink); color: var(--bg); } .week button.on b { color: var(--bg); }
.week button.has::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--rose); margin-top: 2px; }
.sess { display: grid; grid-template-columns: 58px 1fr auto; gap: .7rem; align-items: center; }
.sess .t { font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.15; }
.sess .t small { display: block; font-weight: 400; color: var(--muted); }
.sess .n { font-weight: 600; } .sess .meta { font-size: .82rem; color: var(--muted); }
.cap { height: 5px; border-radius: 3px; background: var(--rose-soft); overflow: hidden; margin-top: 5px; max-width: 160px; } .cap i { display: block; height: 100%; background: var(--rose); } .cap.full i { background: var(--ink); }
.list { display: grid; } .list > .li { padding: .75rem 0; border-bottom: 1px solid var(--rose-line); display: flex; gap: .7rem; align-items: center; } .list > .li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.ask { border: 2px solid var(--ink); }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--rose-soft); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
details.acc { background: var(--card); border-radius: 12px; padding: 0 1rem; }
details.acc + details.acc { margin-top: .5rem; }
details.acc summary { cursor: pointer; padding: .85rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.acc summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--muted); } details.acc[open] summary::after { content: '–'; }
details.acc > div { padding-bottom: .9rem; color: var(--ink); }
.steps { display: flex; gap: 4px; } .steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--rose-soft); } .steps i.on { background: var(--ink); } .steps i.done { background: var(--rose); }
.sigbox { border: 1.5px dashed var(--rose); border-radius: 12px; background: #fff; position: relative; }
.sigbox canvas { width: 100%; height: 150px; display: block; touch-action: none; border-radius: 12px; }
.sigbox .clr { position: absolute; top: 6px; right: 6px; }
.sigbox .hint { position: absolute; left: 12px; bottom: 8px; font-size: .78rem; color: var(--muted); pointer-events: none; }
.doc { max-height: 46vh; overflow: auto; background: #fff; border-radius: 10px; padding: .8rem 1rem; font-size: .86rem; border: 1px solid var(--rose-line); }
.doc table { border-collapse: collapse; } .doc td, .doc th { border: 1px solid #ddd; padding: 2px 6px; }
.contract-view { background: #fff; border-radius: 10px; overflow: auto; max-height: 70vh; border: 1px solid var(--rose-line); }
.price-line { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--rose-line); }
.price-line:last-child { border-bottom: 0; }

/* ===================== Team-Portal ===================== */
.portal { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--rose); padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side .brand { display: flex; gap: .6rem; align-items: center; padding: 0 .4rem 1rem; }
.side .logo { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.4rem; }
.side .grp { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin: 1rem .5rem .3rem; opacity: .8; }
.side button.nav { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .5rem; border: 0; background: transparent; padding: .48rem .65rem; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink); text-align: left; }
.side button.nav:hover { background: rgba(253, 238, 222, .35); } .side button.nav.on { background: var(--bg); }
.side button.nav i { font-style: normal; background: var(--ink); color: var(--bg); font-size: .7rem; border-radius: 9px; padding: 0 .45rem; min-width: 18px; text-align: center; }
.pmain { padding: 1.4rem max(16px, env(safe-area-inset-right, 0px)) 3rem 1.6rem; min-width: 0; display: grid; gap: 1rem; align-content: start; }
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.phead h1 { margin: 0; font-size: 2.1rem; } .phead p { margin: .2rem 0 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; }
.kpi { background: var(--card); border-radius: var(--r); padding: .85rem 1rem; box-shadow: var(--shadow); }
.kpi span { font-size: .78rem; color: var(--muted); display: block; } .kpi b { font-family: var(--display); font-size: 2.1rem; line-height: 1.05; display: block; font-variant-numeric: tabular-nums; } .kpi small { color: var(--muted); }
.kpi.alert { box-shadow: inset 0 0 0 2px var(--warn); }
.bar-h { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 54px; gap: .6rem; align-items: center; font-size: .86rem; padding: .25rem 0; }
.bar-h .tr { height: 12px; background: var(--rose-soft); border-radius: 6px; overflow: hidden; } .bar-h .tr i { display: block; height: 100%; border-radius: 6px; background: var(--rose); }
.bar-h .tr i.hi { background: var(--ink); } .bar-h .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart { width: 100%; height: auto; display: block; } .chart text { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.legend { display: flex; gap: 1rem; font-size: .82rem; flex-wrap: wrap; } .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.drawer-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--rose-line); margin: .4rem 0 .8rem; overflow-x: auto; }
.drawer-tabs button { border: 0; background: none; padding: .5rem .7rem; font-weight: 600; cursor: pointer; border-bottom: 2.5px solid transparent; color: var(--muted); white-space: nowrap; }
.drawer-tabs button.on { color: var(--ink); border-color: var(--ink); }
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: .3rem .8rem; font-size: .9rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] { max-width: 280px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem max(16px, env(safe-area-inset-left, 0px)); }
.login { width: 100%; max-width: 400px; }
@media (max-width: 860px) {
  .portal { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 20; padding: .6rem max(12px, env(safe-area-inset-left, 0px)); display: flex; gap: .3rem; overflow-x: auto; align-items: center; }
  .side .brand { padding: 0 .4rem 0 0; } .side .brand div:last-child { display: none; } .side .grp { display: none; }
  .side button.nav { width: auto; white-space: nowrap; flex: none; }
  .pmain { padding: 1rem max(16px, env(safe-area-inset-right, 0px)) 3rem max(16px, env(safe-area-inset-left, 0px)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .side, .tabbar, .demo-bar, .noprint { display: none !important; } .portal { display: block; } }

.nowrap{white-space:nowrap}
.tbl input[type=time]{width:112px;min-width:0;padding-left:.45rem;padding-right:.3rem}
.tbl td.nowrap input[type=time]{display:inline-block}
