:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #74716c;
  --line: #e6e2dc;
  --soft: #fbf3ea;
  --accent: #f28c1c;
  --accent-dark: #c9690a;
  --accent-ink: #9a4f05;
  --side: #161616;
  --ok: #2e7d32;
  --ok-bg: #e7f4e8;
  --err-bg: #fbe9e7;
  --info-bg: #fdf3e7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 24, 18, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent-dark); }

.doc-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-head h1 { margin: 0; padding-left: 14px; border-left: 2px solid var(--line); line-height: 1.1; }
.logo { height: 34px; width: auto; display: block; }
.card > .logo { margin-bottom: 18px; }

.page { max-width: 1240px; margin: 0; padding: 36px 48px 48px; }
.page.wide { max-width: 1440px; }
.page.narrow { max-width: 440px; margin: 10vh auto 0; padding: 0 16px; }
.card { background: var(--card); padding: 28px; margin-bottom: 20px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
h1 { font-family: Oswald, Inter, sans-serif; font-size: 30px; line-height: 1.15; margin: 0 0 18px; font-weight: 600; letter-spacing: -.005em; }
h2 { font-size: 17px; font-weight: 600; color: var(--text); margin: 30px 0 12px; }
h3 { font-size: 15px; font-weight: 600; color: #3a3835; margin: 22px 0 8px; }
.card > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.req { color: var(--accent); }
.back { font-size: 13px; text-decoration: none; display: inline-block; margin-bottom: 6px; }

label { display: block; font-size: 13px; color: #333; margin-bottom: 14px; }
label > input, label > select, label > textarea { margin-top: 5px; }
label.inline { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 10px; font-size: 13px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=email],
input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 8px 9px; font: inherit; font-size: 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; background: #fff; min-height: 40px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(242, 140, 28, .2); border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: #f7f7f7; color: #444; }
fieldset:disabled .add, fieldset:disabled .sig-clear, fieldset:disabled .sig-modes { display: none; }
fieldset:disabled .rm { visibility: hidden; }

.grid { display: grid; gap: 0 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: 2fr 1.3fr 1.5fr; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-tag { grid-template-columns: 1.15fr .95fr .95fr .95fr 1.15fr .95fr .8fr; align-items: end; }
.g-4, .g-2, .g-3 { align-items: end; }
.g-fahrt { grid-template-columns: .7fr 1.6fr 1.6fr; }
.total { font-size: 13px; color: #333; margin-bottom: 14px; }
.total .lbl { display: block; }
.total output { display: block; margin-top: 5px; padding: 8px 0; font-weight: 600; min-height: 38px; }
.sum { text-align: right; font-size: 14px; margin: 0 0 10px; color: #333; }

.repeat { margin-bottom: 12px; }
.repeat-head, .repeat-row { display: grid; gap: 0; align-items: center; }
.repeat-head { font-size: 13px; color: #333; padding-bottom: 4px; }
.repeat-row { margin-bottom: 6px; }
.repeat-row input { border-radius: 0; margin-left: -1px; }
.g-mat { grid-template-columns: 28px 2.2fr .75fr 2.8fr .75fr 1.4fr .75fr; }
.g-one { grid-template-columns: 28px 1fr; }
.g-spesen { grid-template-columns: 28px 1.6fr .8fr 1.3fr; }
.repeat-head span { padding-left: 8px; }
.rm {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid #555; background: #fff;
  font-size: 14px; line-height: 1; padding: 0; cursor: pointer; color: #333;
}
.rm:hover { border-color: var(--accent); color: var(--accent); }
.num { text-align: right; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; min-height: 40px; font: inherit; font-size: 14px; font-weight: 500; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: #c9c3ba; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1c1006; font-weight: 600; box-shadow: 0 4px 14px rgba(242, 140, 28, .28); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline { border-color: var(--accent); color: var(--accent); font-size: 13px; min-height: 32px; padding: 4px 10px; }
.btn-small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-teams { background: #5b5fc7; border-color: #5b5fc7; color: #fff; }
.btn-teams:hover { background: #4f52b2; border-color: #4f52b2; }
.btn-disabled { color: #8a8acb; border-color: #d6d6ef; border-style: dashed; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-danger { color: #b3261e; border-color: #e3b3ae; }
.btn-danger:hover { background: #fbe9e7; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 20px; }
.toolbar form { margin: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.form-actions.sticky {
  position: sticky; bottom: 0; background: #fff; padding: 12px 0; margin-bottom: -12px;
  border-top: 1px solid var(--line);
}
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.row-between h1 { margin-bottom: 10px; }

.flash { padding: 11px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; background: var(--info-bg); border: 1px solid #f3dcc0; }
.flash-ok { background: var(--ok-bg); color: #1b5e20; }
.flash-error { background: var(--err-bg); color: #8c1d18; }
.flash-ok { border-color: #cfe6d1; } .flash-error { border-color: #f0c9c4; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eee; white-space: nowrap; }
.badge-entwurf { background: #eee; color: #555; }
.badge-geteilt { background: #fff1d6; color: #8a5a00; }
.badge-ausgefuellt { background: #dcefff; color: #0b4f8a; }
.badge-abgeschlossen { background: var(--ok-bg); color: var(--ok); }

.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px; }
table.list td { border-bottom: 1px solid #eee; padding: 8px; vertical-align: middle; }
table.list td.actions { text-align: right; white-space: nowrap; }
table.list td.actions form { display: inline; margin: 0; }

.upload { border: 1px dashed var(--line); background: #fafafa; padding: 12px; margin: -8px 0 18px; }
.upload input[type=file] { font-size: 13px; }
.belege { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
.belege li { margin-bottom: 4px; }

.sig { margin-bottom: 16px; }
.sig .lbl { display: block; font-size: 13px; color: #333; margin-bottom: 5px; }
.sig-box { position: relative; border: 1px solid var(--line); height: 150px; background: #fff; }
.sig-box::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 34px; border-bottom: 1px solid #e3e3e3; pointer-events: none; }
.sig-box canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sig-text { position: absolute; left: 10px; right: 40px; top: 8px; width: auto !important; min-height: 32px !important; }
.sig-clear {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid #555; background: #fff;
  font-size: 14px; line-height: 1; padding: 0; cursor: pointer;
}
.sig-modes { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.sig-modes button { background: none; border: 0; padding: 2px 0; font-size: 12px; cursor: pointer; color: #333; border-bottom: 2px solid transparent; }
.sig-modes button.active { border-bottom-color: #2a7de1; }

.share-link { display: flex; gap: 8px; margin-bottom: 14px; }
.share-link input { flex: 1; }
.share-list { margin-bottom: 12px; }
.inline-form { margin: 0; }
.danger-zone { background: transparent; box-shadow: none; padding: 0 0 20px; text-align: right; }

.steps { padding-left: 20px; margin: 8px 0 0; }
.steps li { margin-bottom: 6px; }
code { background: #f3f3f3; padding: 1px 5px; border-radius: 3px; font-size: 13px; word-break: break-all; }
.chips {display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 13px; }
.count { font-size: 13px; color: var(--muted); font-weight: 400; }
.add-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.add-form-wide { grid-template-columns: 1.3fr 1fr 1.3fr 1.1fr auto; }


/* Wochenkalender */
.week-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.week-nav-l { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-nav-l h2 { margin: 0 0 0 8px; font-size: 20px; color: var(--text); font-weight: 600; }
.week-nav-l h2 .muted { font-weight: 400; }
.btn-icon { width: 32px; padding: 0; font-size: 20px; line-height: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg a { padding: 6px 12px; font-size: 13px; color: var(--text); text-decoration: none; background: #fff; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.active { background: var(--soft); color: var(--accent-ink); font-weight: 600; }
.cal-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.cal { min-width: 720px; --gut: 52px; }
.cal-head, .cal-allday, .cal-body { display: grid; grid-template-columns: var(--gut) repeat(7, minmax(0, 1fr)); }
.cal-dayhead { padding: 6px 4px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.cal-dayhead .dh-date { display: inline-block; font-size: 15px; padding: 3px 10px; border-radius: 999px; color: #333; }
.cal-dayhead .dh-date b { font-size: 18px; }
.cal-dayhead.today .dh-date { background: #fdebd8; color: var(--accent-dark); }
.cal-dayhead.weekend .dh-date { color: #aaa; }
.cal-dayhead .dh-sum { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 30px; }
.cal-gutter { font-size: 11px; color: var(--muted); padding: 6px 6px 0 0; text-align: right; }
.cal-allcell { border-left: 1px solid #eee; padding: 3px; display: flex; flex-direction: column; gap: 3px; }
.cal-allcell.weekend, .cal-col.weekend { background: #fafafa; }
.chip { display: block; font-size: 11px; line-height: 1.3; padding: 2px 6px; border-radius: 3px; text-decoration: none;
        color: #1f1f1f; background: color-mix(in srgb, var(--c, #ccc) 22%, #fff); border-left: 3px solid var(--c, #ccc);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-holiday { --c: #bbb; color: #666; }
.cal-body { position: relative; }
.cal-hours { position: relative; padding: 0; }
.cal-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-hours span:first-child { transform: none; }
.cal-col { position: relative; border-left: 1px solid #eee; cursor: crosshair; touch-action: pan-y; user-select: none; }
.cal-col.today { background: #fffaf4; }
.cal-hline { position: absolute; left: 0; right: 0; border-top: 1px solid #eee; pointer-events: none; }
.cal-hline::after { content: ""; position: absolute; left: 0; right: 0; top: 24px; border-top: 1px dashed #f3f3f3; }
.cal-now { position: absolute; left: -1px; right: 0; border-top: 2px solid #e4572e; z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: #e4572e; }
.cal-ev { position: absolute; box-sizing: border-box; padding: 3px 5px; border-radius: 4px; overflow: hidden; z-index: 2;
          background: color-mix(in srgb, var(--c) 18%, #fff); border-left: 3px solid var(--c); color: #1f1f1f;
          text-decoration: none; font-size: 11.5px; line-height: 1.25; border-right: 2px solid #fff; cursor: pointer; }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 30%, #fff); }
.ev-time { display: block; font-size: 10.5px; color: #555; font-variant-numeric: tabular-nums; }
.ev-title { display: block; font-weight: 600; }
.ev-sub { display: block; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-sel { position: absolute; left: 2px; right: 2px; background: rgba(242, 140, 28, .15); border: 1px dashed var(--accent);
           border-radius: 4px; font-size: 11px; padding: 2px 4px; color: var(--accent-dark); z-index: 4; pointer-events: none; }
dialog.quick { border: 0; border-radius: 8px; padding: 22px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.quick::backdrop { background: rgba(0,0,0,.35); }
dialog.quick h2 { margin-top: 0; }
.g-quick { grid-template-columns: 1.4fr 1fr 1fr 1fr; align-items: end; }
@media (max-width: 760px) {
  .g-quick { grid-template-columns: 1fr 1fr; }
  .week-nav-l h2 { font-size: 17px; margin-left: 4px; }
}

/* Zeiterfassung */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 6px; }
.kpi { background: var(--soft); border: 1px solid #f1e2cf; border-radius: var(--radius); padding: 12px 14px; }
.kpi-lbl { display: block; font-size: 12px; color: var(--muted); }
.kpi-val { display: block; font-size: 22px; font-weight: 700; margin-top: 2px; }
.kpi-val small { font-size: 13px; font-weight: 400; color: var(--muted); }
.pos { color: var(--ok); }
.neg { color: #b3261e; }
.r { text-align: right !important; white-space: nowrap; }
.small { font-size: 12px; }
.center { text-align: center; margin: 0 0 8px; font-size: 13px; }
.g-timer { grid-template-columns: 1.5fr 1.2fr 1.5fr auto; align-items: end; }
.g-timer .btn-big { margin-bottom: 14px; }
.btn-big { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.timer-running { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.timer-clock { display: block; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.g-entry { grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr; align-items: end; }
.g-absenz { grid-template-columns: 1.4fr 1fr 1fr auto 1.4fr auto; align-items: end; margin-top: 12px; }
.g-absenz .btn { margin-bottom: 14px; }
label.check { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
details.absenz { margin-top: 18px; border-top: 1px solid #eee; padding-top: 12px; }
details.absenz summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.week-nav { align-items: center; }
.week-nav h2 { margin: 0; text-align: center; }
.day { border-top: 1px solid #eee; padding: 8px 0; }
.day.today .day-head strong { color: var(--accent); }
.day.off { opacity: .55; }
.day-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.day-sum { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; color: #333; }
.day-sum.under { color: var(--muted); }
.entry { display: grid; grid-template-columns: 92px 1fr 56px auto; gap: 8px; align-items: center; padding: 5px 0 5px 10px; font-size: 14px; border-left: 3px solid #f2c79a; margin: 4px 0; }
.entry.absence { border-left-color: #9ec5ea; background: #f5f9fd; }
.e-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.e-dur { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.e-act { display: flex; gap: 2px; }
.e-act form { margin: 0; }
.tag-src { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.entry-edit { background: #faf7f3; padding: 12px; margin: 6px 0; border-radius: var(--radius); }
.add-form-proj { grid-template-columns: 1fr 1.5fr 2fr auto; }
.proj-edit { display: grid; grid-template-columns: 1fr 1.5fr 2fr auto; gap: 6px; }
tr.inactive td { opacity: .6; }
.inline-lbl { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline-lbl input { width: auto; margin: 0; }

@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr; }
  .g-timer, .g-entry, .g-absenz, .add-form-proj, .proj-edit { grid-template-columns: 1fr; }
  .g-entry { grid-template-columns: 1fr 1fr; }
  .entry { grid-template-columns: 1fr auto; }
  .entry .e-time { grid-column: 1 / -1; }
  .e-act { grid-column: 1 / -1; }

  .page { padding: 20px 12px 32px; }
  .page.narrow { margin-top: 0; padding: 16px; }
  .card { padding: 20px 16px; margin-bottom: 12px; border-radius: 14px; }
  .g-2, .g-3, .g-fahrt { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-tag { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid #eee; }
  .g-mat { grid-template-columns: 28px 1fr 70px; }
  .g-mat > :nth-child(4), .g-mat > :nth-child(6) { grid-column: 2; }
  .repeat-head.g-mat { display: none; }
  .repeat-row.g-mat { padding-bottom: 8px; border-bottom: 1px solid #eee; margin-bottom: 10px; row-gap: 4px; }
  .add-form-wide { grid-template-columns: 1fr; }
  .share-link { flex-direction: column; }
}

.dlg-delete { margin-left: auto; }
dialog.quick { max-height: calc(100vh - 24px); overflow-y: auto; }

/* Spesen */
.g-spesen-form { grid-template-columns: 1fr 1.3fr 1fr .8fr; align-items: end; }
.badge-offen { background: #eee; color: #555; }
.badge-eingereicht { background: #fff1d6; color: #8a5a00; }
.badge-zurueckgewiesen { background: #fbe9e7; color: #8c1d18; }
.badge-genehmigt { background: #dcefff; color: #0b4f8a; }
.badge-ausbezahlt { background: var(--ok-bg); color: var(--ok); }
.sp-table td { vertical-align: top; }
.sp-belege a { display: inline-block; margin-right: 6px; font-size: 13px; }
.warn { color: #b3261e; font-size: 12px; }
.month-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.month-nav h2 { margin: 0 0 0 8px; color: var(--text); font-weight: 600; }
.verlauf { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.verlauf a { font-size: 12px; text-decoration: none; border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; color: var(--text); }
.verlauf a.cur { border-color: var(--accent); }
@media (max-width: 760px) { .g-spesen-form { grid-template-columns: 1fr 1fr; } .g-spesen { grid-template-columns: 28px 1fr 90px; } .g-spesen > :nth-child(4) { grid-column: 2 / -1; } .repeat-head.g-spesen span:nth-child(4) { display: none; } }

/* ================================================================ KCH Workspace – Layout */
.ws-plain .page:not(.narrow) { margin: 28px auto; padding: 0 16px; max-width: 900px; }
.ws { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: 272px; flex: 0 0 272px; overflow-y: auto;
  background: var(--side); color: #f2efea; display: flex; flex-direction: column; padding: 34px 20px 20px;
}
.side-brand { display: block; padding: 0 12px 30px; text-decoration: none; }
.side-brand img { height: 27px; width: auto; display: block; }
.side-sub { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 12px; font-weight: 600;
            letter-spacing: .26em; text-transform: uppercase; color: #d9d4cc; }
.side-sub i { width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.side-lbl { margin: 18px 12px 10px; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #8d877e; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 4px; border-radius: 12px;
  color: #e8e4de; text-decoration: none; font-size: 15px; font-weight: 500; border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-item.on { background: linear-gradient(90deg, rgba(242, 140, 28, .22), rgba(242, 140, 28, .1)); border-color: rgba(242, 140, 28, .45);
               color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item.on svg { stroke: var(--accent); opacity: 1; }
.nav-badge { margin-left: auto; min-width: 24px; padding: 2px 7px; border-radius: 7px; background: #5a3a12; color: #ffb35c;
             font-size: 12px; font-weight: 700; text-align: center; }
.side-foot { margin-top: auto; padding-top: 24px; }
.side-claim { border-top: 1px solid #2c2b29; margin: 0 12px 16px; padding-top: 22px; }
.side-claim p { margin: 0 0 8px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 10px; }
.side-claim p i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.side-claim span { display: block; font-size: 13.5px; color: #a39d94; line-height: 1.6; }
.side-wave { width: 90px; height: 52px; margin-top: 18px; display: block; }
.side-wave rect { fill: #6b4318; }
.side-wave rect.hi { fill: var(--accent); }
.nav-out { border-top: 1px solid #2c2b29; border-radius: 0; margin: 0; padding-top: 16px; color: #bdb7ae; font-size: 14px; }
.side-scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.head {
  display: flex; align-items: center; gap: 16px; padding: 0 48px; height: 82px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.head-menu { display: none; }
.crumb { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--muted); min-width: 0; }
.crumb a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.crumb a:hover { color: var(--text); }
.crumb span { color: #c5bfb6; }
.crumb b { color: var(--text); font-weight: 600; white-space: nowrap; }
.head-r { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.stage { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 9px; background: var(--soft);
         color: var(--accent-ink); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.stage i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.head-date { font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #fcebd6; color: var(--accent-dark); display: grid; place-items: center;
          font-size: 13px; font-weight: 700; flex: none; }

/* Übersicht */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 18px 0 30px; }
.eyebrow { margin: 0 0 14px; font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: #6b6762; }
.hero-title { font-size: 50px; line-height: 1.05; margin: 0 0 14px; letter-spacing: -.01em; }
.hero-title span { color: #8e8a85; font-weight: 500; }
.hero-sub { margin: 0; color: var(--muted); font-size: 16px; }
.hero-act { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-act form { margin: 0; }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 15px; font-weight: 600; border-radius: 11px; }
.note { display: flex; align-items: center; gap: 12px; padding: 14px 20px; margin-bottom: 26px; border-radius: 12px;
        background: #fdf6ee; border: 1px solid #f3e1cb; font-size: 14px; color: #4b4741; }
.note svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #8a8178; stroke-width: 1.7; stroke-linecap: round; }
.note b { color: var(--accent-ink); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-bottom: 26px; }
.stat { display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px 26px; color: inherit;
        text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: #e8c9a3; transform: translateY(-1px); }
.stat-hi { background: linear-gradient(180deg, #fdf1e3, #fdf5ec); border-color: #f6dcbc; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: #5d5953; font-size: 15px; }
.stat-top i { width: 40px; height: 40px; border-radius: 10px; background: #f6f3ef; display: grid; place-items: center; }
.stat-hi .stat-top i { background: #fae1c2; }
.stat-top svg { width: 21px; height: 21px; fill: none; stroke: #8c8780; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stat-hi .stat-top svg { stroke: var(--accent-dark); }
.stat-val { font-family: Oswald, Inter, sans-serif; font-size: 42px; font-weight: 600; line-height: 1; margin: 22px 0 16px; letter-spacing: -.01em; }
.stat-hi .stat-val { color: #b25d06; }
.stat-val small { font-family: Inter, sans-serif; font-size: 16px; font-weight: 400; color: var(--muted); margin-left: 7px; }
.stat-val.pos { color: var(--ok); } .stat-val.neg { color: #b3261e; }
.stat-sub { margin: 0; font-size: 13px; color: #6f6b65; }

.dash { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 32px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { margin: 0 0 4px; font-size: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.panel-head p { margin: 0; font-size: 14px; }
.seg-soft a { padding: 8px 16px; font-size: 13px; color: var(--muted); }
.seg-soft a.active { background: #f6f3ef; color: var(--text); font-weight: 600; }
.legend { display: flex; justify-content: flex-end; gap: 18px; margin: 18px 0 6px; font-size: 13px; color: #6f6b65; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.lg-ist { background: #f39c3c; } .lg-soll { background: #f7e3cf; }
.chart { display: grid; grid-template-columns: 40px 1fr; height: 260px; margin-top: 10px; }
.chart-axis { position: relative; height: calc(100% - 28px); }
.chart-axis span { position: absolute; left: 0; transform: translateY(50%); font-size: 11.5px; color: #8b867f; }
.chart-plot { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.chart-grid { position: absolute; left: 0; right: 0; top: 0; bottom: 28px; pointer-events: none; }
.chart-grid i { position: absolute; left: 0; right: 0; border-top: 1px solid #f0ece6; }
.bar-col { display: flex; flex-direction: column; align-items: center; min-width: 0; position: relative; z-index: 1; }
.bar-track { position: relative; flex: 1; width: 100%; display: flex; justify-content: center; }
.bar-soll, .bar-ist { position: absolute; bottom: 0; width: min(30px, 46%); border-radius: 5px 5px 0 0; }
.bar-soll { background: #f8e8d7; }
.bar-ist { background: #f39c3c; width: min(30px, 46%); }
.bar-col.today .bar-ist { background: var(--accent-dark); }
.bar-lbl { height: 28px; line-height: 28px; font-size: 12.5px; color: #6f6b65; }
.bar-col.today .bar-lbl { color: var(--accent-dark); font-weight: 700; }
.bar-col.we .bar-lbl { color: #b3aea7; }
.chart-monat .bar-soll, .chart-monat .bar-ist { width: 62%; border-radius: 3px 3px 0 0; }
.chart-monat .bar-lbl { font-size: 10.5px; }
.chart-monat .bar-col:nth-child(even) .bar-lbl { visibility: hidden; }
.panel-title { display: flex; align-items: center; gap: 12px; font-size: 18px !important; }
.panel-title svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; }
.panel-lead { margin: 20px 0 24px; font-size: 15px; line-height: 1.75; }
.quick-list { display: grid; gap: 14px; }
.quick-list form { margin: 0; }
.quick-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px;
              background: #fff; color: var(--text); text-decoration: none; font: inherit; text-align: left; cursor: pointer;
              transition: border-color .15s, background .15s; }
.quick-item:hover { border-color: #ecc89c; background: #fffaf4; }
.quick-item i { width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--soft); display: grid; place-items: center; }
.quick-item i svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-dark); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.quick-item span { flex: 1; min-width: 0; }
.quick-item b { display: block; font-weight: 600; font-size: 15px; }
.quick-item small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.quick-item .arr { width: 20px; height: 20px; fill: none; stroke: #8b867f; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.panel-sub { margin: 28px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0ece6;
               color: var(--text); text-decoration: none; }
.mini-list li:last-child a { border-bottom: 0; }
.mini-list b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list small { display: block; font-size: 12.5px; color: var(--muted); }
.mini-list span:first-child { min-width: 0; }

@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .head-date { display: none; }
}
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; }
  .nav-open .side { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .3); }
  .nav-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .head { padding: 0 16px; height: 64px; gap: 10px; }
  .head-menu { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; flex: none; }
  .head-menu svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; }
  .crumb a, .crumb span { display: none; }
  .page { padding: 24px 16px 36px; }
}
@media (max-width: 600px) {
  .stage { display: none; }
  .hero-title { font-size: 38px; }
  .hero-act, .hero-act form, .hero-act .btn { width: 100%; }
  .stats { gap: 12px; }
  .stat { padding: 18px 18px 20px; }
  .stat-val { font-size: 32px; margin: 16px 0 10px; }
  .stat-top { font-size: 13.5px; }
  .stat-top i { width: 34px; height: 34px; }
  .panel { padding: 22px 18px; }
  .chart { height: 220px; grid-template-columns: 32px 1fr; }
}
@media (max-width: 440px) {
  .stat { padding: 16px 14px 16px; }
  .stat-val { font-size: 28px; }
  .stat-val small { font-size: 13px; margin-left: 4px; }
  .stat-top i { display: none; }
  .stat-sub { font-size: 12px; }
  .hero-title { font-size: 34px; }
}

/* Anmeldung */
.ws-plain:has(.login) { background: var(--side); }
.login-card { background: #1f1e1d; border: 1px solid #2f2d2b; border-radius: 20px; padding: 40px 36px; color: #f2efea; }
.login-card img { height: 30px; display: block; }
.login-card h1 { font-size: 40px; margin: 34px 0 10px; color: #fff; }
.login-lead { color: #a39d94; font-size: 14px; margin: 0 0 26px; }
.login-card label { color: #d9d4cc; }
.login-card input { background: #151515; border-color: #3a3734; color: #fff; }
.login-card .btn { width: 100%; margin-top: 6px; }
.login .flash { margin-bottom: 16px; }

/* Im Workspace steht das Logo schon in der Seitenleiste */
.ws .doc-head .logo, .ws .card > .logo { display: none; }
.ws .doc-head h1 { padding-left: 0; border-left: 0; }

/* Kalender: Einträge ziehen */
.cal-ev.can-move { cursor: grab; }
.cal-ev .ev-grip { position: absolute; left: 0; right: 0; height: 7px; cursor: ns-resize; touch-action: none; z-index: 1; }
.cal-ev .ev-grip-t { top: -1px; }
.cal-ev .ev-grip-b { bottom: -1px; }
.cal-ev .ev-grip-b::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; margin-left: -9px; height: 2px;
                            border-radius: 2px; background: color-mix(in srgb, var(--c) 60%, #fff); opacity: 0; transition: opacity .15s; }
.cal-ev.can-move:hover .ev-grip-b::after { opacity: 1; }
.cal-ev.dragging { z-index: 6; opacity: .92; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); cursor: grabbing; transition: none; }
.cal-ev.saving { opacity: .6; pointer-events: none; }
body.cal-dragging, body.cal-dragging * { cursor: grabbing !important; user-select: none; }
@media (pointer: fine) { .cal-ev.can-move { touch-action: none; } }
.rollen-wahl { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; grid-column: 1 / -1; font-size: 14px; }
