[hidden] { display: none !important; }
:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1f2933; --muted: #6b7684; --line: #e3e6ea;
  --brand: #29509f; --brand-d: #1f3f80; --accent: #f78a4f; --green: #afcd65; --grey: #605655; --dark: #29509f;
  --ok: #1e9e5a; --ok-bg: #e3f6ec; --bad: #d64545; --bad-bg: #fde8e8; --warn: #b7791f; --warn-bg: #fdf3dc; --info: #2f6fdd; --info-bg: #e5eefc;
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12171c; --card: #1c232b; --ink: #eef1f4; --muted: #9aa5b1; --line: #2c353f;
    --ok-bg: #173826; --bad-bg: #3e1d1d; --warn-bg: #3b2f14; --info-bg: #1a2a45; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.2; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small, small { font-size: .82rem; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* Header + Tabs */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .8rem; padding: calc(env(safe-area-inset-top) + .5rem) 1rem .5rem; background: var(--card); color: var(--ink); border-bottom: 3px solid; border-image: linear-gradient(90deg, var(--accent) 0 33%, var(--green) 33% 66%, var(--brand) 66%) 1; }
.logo-box { display: inline-flex; background: #fff; border-radius: 10px; padding: 4px 6px; }
.logo-box.big { padding: 14px 18px; border-radius: 18px; box-shadow: 0 2px 10px #0000000f; margin-bottom: .6rem; }
.logo { height: 40px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.brand { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; text-align: right; }
.brand b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand b { font-size: .95rem; } .brand small { color: var(--muted); }
.demo-pill { background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
main { padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; border: 0; background: none; padding: .55rem 0 .5rem; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--muted); cursor: pointer; }
.tabs button.on { color: var(--brand); font-weight: 600; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.btn svg { width: 20px; height: 20px; }

/* Karten */
.card { background: var(--card); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 3px #0000000f; }
.card.hint { background: var(--info-bg); font-size: .9rem; }
.card.alert { background: var(--warn-bg); display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.card.err { background: var(--bad-bg); color: var(--bad); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.card-h h3 { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 12px; padding: .7rem 1rem; font-weight: 600; cursor: pointer; background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .6; }
.btn.big { width: 100%; padding: .95rem; font-size: 1.05rem; margin-top: .5rem; }
.btn.huge { width: 100%; padding: 1.3rem; font-size: 1.3rem; border-radius: 18px; margin-top: .8rem; }
.btn.small { padding: .4rem .7rem; font-size: .85rem; border-radius: 9px; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.go { background: var(--ok); color: #fff; }
.btn.stop, .btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.icon { border: 0; background: none; font-size: 1.15rem; padding: .35rem .45rem; cursor: pointer; border-radius: 8px; }
.icon:disabled { opacity: .25; }
.link { border: 0; background: none; color: var(--brand); font-weight: 600; padding: .5rem 0; cursor: pointer; text-align: left; }
.row { display: flex; gap: .6rem; } .row > * { flex: 1; min-width: 0; }

/* Formulare */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .7rem; }
input { display: block; width: 100%; margin-top: .3rem; padding: .75rem .8rem; border: 1.5px solid var(--line); border-radius: 11px; background: var(--card); font-size: 1rem; min-height: 48px; }
input:focus { outline: none; border-color: var(--brand); }
.calc { background: var(--bg); padding: .7rem .8rem; border-radius: 11px; margin-bottom: .4rem; font-size: .95rem; }
.calc:empty { display: none; }
.warn { color: var(--warn); font-size: .82rem; margin-top: .3rem; }

/* Login */
.login { max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 2.5rem) 1rem 2rem; text-align: center; }
.login-logo { width: 240px; max-width: 70vw; height: auto; display: block; }
.login h1 { margin-bottom: .2rem; }
.login form, .login .card { text-align: left; margin-top: 1.2rem; }

/* Stempeluhr */
.clock-card { text-align: center; padding: 1.4rem 1rem; border-top: 6px solid var(--line); }
.clock-card.running { border-top-color: var(--ok); }
.clock-card.paused { border-top-color: var(--warn); }
.clock-date { color: var(--muted); font-size: .95rem; }
.clock-time { font-size: 3.4rem; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.site { text-align: left; margin-top: .6rem; }
.status { font-weight: 600; margin: .3rem 0 .8rem; }
.running .status { color: var(--ok); } .paused .status { color: var(--warn); }
.elapsed { background: var(--bg); border-radius: 14px; padding: .8rem; margin-bottom: .4rem; }
.elapsed span { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.elapsed small { display: block; color: var(--muted); }

/* Listen */
.entry { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.entry:last-of-type { border-bottom: 0; }
.right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.acts { display: flex; flex-direction: row; align-items: center; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.entry.abs.krank { border-left: 4px solid var(--bad); padding-left: .6rem; }
.entry.abs.urlaub { border-left: 4px solid var(--ok); padding-left: .6rem; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--bg); color: var(--muted); vertical-align: middle; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.info { background: var(--info-bg); color: var(--info); }
.c-ok { color: var(--ok); } .c-bad { color: var(--bad); }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; font-size: 1.1rem; }
.month-nav .icon { font-size: 1.8rem; padding: 0 .8rem; }
.stat-big { text-align: center; background: linear-gradient(135deg, var(--brand), #1f3f80); color: #fff; }
.stat-big div { font-size: 2.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-big div span { font-size: 1.1rem; font-weight: 600; opacity: .7; }
.stat-big small { opacity: .75; }
.stat { font-size: 1.6rem; font-weight: 800; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.tile { border: 0; border-radius: var(--r); padding: 1.2rem .6rem; font-weight: 700; font-size: 1rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; cursor: pointer; color: #fff; }
.tile span { font-size: 2.2rem; }
.tile.krank { background: var(--bad); } .tile.urlaub { background: var(--ok); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.mini { background: var(--bg); border-radius: 12px; padding: .7rem .3rem; text-align: center; }
.mini b { display: block; font-size: 1.35rem; } .mini small { color: var(--muted); }

.emp { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; border: 0; background: none; padding: .8rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.emp:last-child { border-bottom: 0; }
.emp .hrs { font-size: 1.25rem; }

/* Foto */
.photo { margin: .4rem 0 .6rem; text-align: center; }
.au-prev { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; margin-top: .5rem; background: var(--bg); }
.au-full { width: 100%; border-radius: 12px; margin-bottom: .8rem; }

.profile { text-align: center; }
.avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto .8rem; }
.logo-edit { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.logo-edit img { width: 140px; height: 90px; padding: 6px; background: #fff; object-fit: contain; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.logo-edit div { display: flex; flex-direction: column; align-items: flex-start; }

/* Bottom-Sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: #0000; display: flex; align-items: flex-end; justify-content: center; transition: background .25s; }
.sheet-wrap.open { background: #0008; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 1.4rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s ease-out; }
.sheet.full { min-height: 80vh; }
.open .sheet { transform: none; }
.sheet-x { position: absolute; top: .6rem; right: .6rem; border: 0; background: var(--bg); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.sheet h2 { padding-right: 2.5rem; }

.toast { position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: #2b2b2b; color: #fff; padding: .7rem 1.1rem; border-radius: 12px; z-index: 50; transition: .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }
