/*
  Gravitat-Look nach gravitat.at: tiefes Grün #101c19, Mint #93ffe6, Lavendel #986edc,
  Pillen-Buttons, geometrische Formen. Schrift: "The Future" (Lizenz Gravitat) falls vorhanden,
  sonst Outfit / DM Mono (OFL, selbst gehostet – keine Google-Server, DSGVO).
*/
@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url(/fonts/outfit-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url(/fonts/outfit-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600 700; font-display: swap; src: url(/fonts/outfit-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 400; font-display: swap; src: url(/fonts/dm-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  --deep: #101c19;
  --deep-2: #1b2b27;
  --mint: #93ffe6;
  --mint-2: #5fe3c5;
  --mint-soft: #e4fff8;
  --lav: #986edc;
  --lav-soft: #efe7fb;
  --ink: #131313;
  --ink-2: #3d4a47;
  --muted: #7d8784;
  --line: #e2e7e5;
  --bg: #f3f6f5;
  --card: #ffffff;
  --ok: #0d6b55;
  --ok-soft: #dcfaf1;
  --bad: #b42318;
  --bad-soft: #fde7e5;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,28,25,.04), 0 6px 20px rgba(16,28,25,.06);
  --font: "The Future", "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "The Future Mono", "DM Mono", ui-monospace, Menlo, monospace;
  font-family: var(--font);
  color: var(--ink);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--deep); text-decoration-color: var(--mint-2); text-underline-offset: 3px; }
h1 { font-size: 34px; font-weight: 500; margin: 0 0 4px; letter-spacing: -.015em; line-height: 1.1; }
h2 { font-size: 20px; font-weight: 500; margin: 0 0 12px; }
h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* Layout */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--deep); color: #fff; padding: 26px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 2px 10px 30px; }
.brand img { height: 28px; width: auto; display: block; }
.brand span { display: block; font-family: var(--mono); font-size: 12px; color: var(--mint); opacity: .75; margin-top: 8px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 999px; color: #dfe9e6; text-decoration: none; font-size: 16px; }
.nav a:hover { background: var(--deep-2); color: var(--mint); }
.nav a.active { background: var(--mint); color: var(--deep); font-weight: 600; }
.nav .ico { width: 20px; text-align: center; font-size: 14px; }
.nav .lbl-short { display: none; }
.nav .badge { margin-left: auto; background: var(--lav); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; font-weight: 600; }
.side .me { margin-top: auto; border-top: 1px solid #2a3b37; padding: 16px 12px 0; font-size: 14px; color: #c9d6d2; }
.side .me b { display: block; color: #fff; font-weight: 500; }
.side .me .btn { color: var(--mint); }
.main { padding: 32px 36px 64px; max-width: 1300px; width: 100%; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head .muted { font-size: 16px; }
.demo-bar { background: var(--lav-soft); color: #4b2a87; font-size: 14px; padding: 9px 16px; border-radius: 12px; margin-bottom: 22px; }

/* Formulare */
input, select, textarea { font: inherit; font-size: 16px; color: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--mint-soft); border-color: var(--mint-2); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--deep); }
label.f { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label.f > input, label.f > select, label.f > textarea { margin-top: 6px; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.btn { font: inherit; font-size: 15px; font-weight: 600; border: 1.5px solid var(--deep); background: transparent; color: var(--deep); padding: 9px 20px; border-radius: 999px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.btn:hover { background: var(--deep); color: var(--mint); }
.btn.primary { background: var(--mint); border-color: var(--mint); color: var(--deep); }
.btn.primary:hover { background: var(--deep); border-color: var(--deep); color: var(--mint); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: transparent; color: inherit; text-decoration: underline; }
.btn.danger { color: var(--bad); border-color: #e9b8b3; }
.btn.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 5px 13px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .chip:focus-visible, .nav a:focus-visible { outline: 3px solid var(--lav); outline-offset: 2px; }
.search { position: relative; min-width: 260px; flex: 1; max-width: 440px; }
.search input { border-radius: 999px; padding-left: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 15px; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--deep); }
.chip.on { background: var(--deep); color: var(--mint); border-color: var(--deep); }
.tabs { display: inline-flex; background: #e6ecea; border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 15px; font-weight: 500; border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.tabs button.on { background: var(--deep); color: var(--mint); }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; margin-top: 20px; }
.res { overflow: hidden; display: flex; flex-direction: column; }
.res .cover { height: 132px; position: relative; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.res .cover svg.deco { position: absolute; right: -10px; bottom: -14px; width: 170px; height: 150px; pointer-events: none; }
.res .cover .cat { font-family: var(--mono); font-size: 12px; position: relative; }
.res .cover .mono-big { font-size: 46px; font-weight: 500; line-height: 1; position: relative; letter-spacing: -.02em; }
.res .price { position: absolute; right: 12px; top: 12px; background: rgba(255,255,255,.95); color: var(--deep); font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 11px; }
.res .fav { position: absolute; right: 12px; bottom: 10px; background: none; border: 0; font-size: 24px; cursor: pointer; line-height: 1; color: inherit; }
.res .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.res .meta { font-size: 14px; color: var(--ink-2); display: flex; gap: 14px; flex-wrap: wrap; }
.res .desc { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 13px; background: var(--bg); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); }
.tag.lav { background: var(--lav-soft); color: #5b33a3; }
.res .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.res .actions .btn { flex: 1; justify-content: center; }

.pill { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 2px 10px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--lav-soft); color: #5b33a3; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--mint-soft); color: var(--deep); }
.pill.neutral { background: var(--bg); color: var(--ink-2); }

/* Buchungsliste */
.blist { display: flex; flex-direction: column; gap: 10px; }
.bitem { display: grid; grid-template-columns: 90px 1fr auto; gap: 18px; align-items: center; padding: 14px 20px; }
.bdate { text-align: center; border-right: 1px solid var(--line); padding-right: 16px; }
.bdate .d { font-size: 28px; font-weight: 500; line-height: 1; }
.bdate .m { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bdate .w { font-size: 13px; color: var(--ink-2); }
.bmain .t { font-weight: 600; font-size: 17px; }
.bmain .s { font-size: 14px; color: var(--ink-2); margin-top: 3px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: 0; box-shadow: inset 0 0 0 1px rgba(16,28,25,.15); }

.note { margin-top: 8px; font-size: 14px; color: var(--ink); background: var(--mint-soft); border-radius: 10px; padding: 7px 11px; max-width: 640px; }
.note-l { font-family: var(--mono); font-size: 11px; color: var(--ok); margin-right: 8px; }
.empty { text-align: center; padding: 44px; color: var(--muted); }

/* Wochenkalender */
.week { display: grid; grid-template-columns: 58px repeat(7, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.week .wh { padding: 11px 6px; text-align: center; font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.week .wh.today { background: var(--mint); color: var(--deep); font-weight: 600; }
.week .wh.closed { color: var(--muted); }
.week .hl { height: 44px; font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; border-top: 1px solid #eef2f1; }
.week .col { position: relative; border-left: 1px solid var(--line); }
.week .slot { height: 22px; border-top: 1px solid #f5f7f6; cursor: pointer; }
.week .slot:nth-child(odd) { border-top-color: #eef2f1; }
.week .slot:hover { background: var(--mint-soft); }
.week .col.closed .slot { background: repeating-linear-gradient(45deg, #f8faf9, #f8faf9 6px, #f0f3f2 6px, #f0f3f2 12px); cursor: not-allowed; }
.week .past { background: rgba(243,246,245,.75); position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 9px; padding: 3px 7px; font-size: 12px; overflow: hidden; cursor: pointer; line-height: 1.25; box-shadow: 0 1px 2px rgba(16,28,25,.12); }
.ev.other { background: #dfe5e3 !important; color: var(--ink-2) !important; cursor: default; box-shadow: none; }
.ev.requested { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px); outline: 2px dashed var(--lav); outline-offset: -2px; }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* Tagesplan */
.plan { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.plan table { border-collapse: collapse; width: 100%; min-width: 900px; }
.plan th, .plan td { border-bottom: 1px solid var(--line); }
.plan th.rn { text-align: left; padding: 10px 14px; font-size: 14px; font-weight: 500; width: 200px; position: sticky; left: 0; background: #fff; z-index: 1; }
.plan .hrs { display: grid; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.plan .lane { position: relative; height: 48px; }
.plan .lane .ev { top: 7px; bottom: 7px; left: auto; right: auto; }
.plan .grid { position: absolute; inset: 0; display: grid; }
.plan .grid div { border-left: 1px solid #eef2f1; cursor: pointer; }
.plan .grid div:hover { background: var(--mint-soft); }

/* Dialog */
.backdrop { position: fixed; inset: 0; background: rgba(16,28,25,.55); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 640px; box-shadow: 0 24px 70px rgba(16,28,25,.35); }
.modal header { display: flex; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; flex: 1; font-size: 22px; }
.modal .content { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal footer { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fafcfb; }
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays label { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 0; width: 46px; text-align: center; font-size: 14px; cursor: pointer; background: #fff; user-select: none; }
.weekdays input { display: none; }
.weekdays label:has(input:checked) { background: var(--deep); color: var(--mint); border-color: var(--deep); }
.check { font-size: 14px; border-radius: 12px; padding: 11px 14px; }
.check.ok { background: var(--ok-soft); color: var(--ok); }
.check.bad { background: var(--bad-soft); color: var(--bad); }
.check.warn { background: var(--lav-soft); color: #4b2a87; }
.check ul { margin: 6px 0 0; padding-left: 18px; max-height: 150px; overflow: auto; }
.scope { display: flex; gap: 10px; flex-wrap: wrap; }
.scope label { flex: 1; min-width: 200px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; font-size: 15px; }
.scope label:has(input:checked) { border-color: var(--deep); background: var(--mint-soft); }

/* Eventangaben */
.flabel { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; background: #fff; font-weight: 400; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--deep); color: var(--mint); border-color: var(--deep); }
.settings { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.setting { border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 8px 10px; cursor: pointer; background: #fff; text-align: center; font-size: 14px; font-weight: 500; }
.setting input { display: none; }
.setting svg { display: block; width: 100%; height: auto; margin-bottom: 4px; }
.setting:hover { border-color: var(--deep); }
.setting:has(input:checked) { border-color: var(--deep); background: var(--mint-soft); box-shadow: inset 0 0 0 1px var(--deep); }
.ev-note { background: var(--lav-soft); }
.ev-note .note-l { color: #5b33a3; }
@media (max-width: 600px) { .settings { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Tabellen */
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { text-align: left; font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: 13px; }
pre.mail { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; background: var(--bg); padding: 12px; border-radius: 10px; margin: 8px 0 0; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.login .l { display: flex; flex-direction: column; justify-content: center; padding: 48px; max-width: 540px; margin: 0 auto; width: 100%; }
.login .l .brand { padding: 0 0 40px; }
.login .l .brand span { color: var(--ink-2); }
.login .r { background: var(--deep); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.login .r svg.deco { position: absolute; inset: 0; width: 100%; height: 100%; }
.login .r h2 { font-size: 40px; font-weight: 500; line-height: 1.1; max-width: 460px; position: relative; color: var(--mint); }
.login .r p { max-width: 440px; position: relative; color: #dfe9e6; font-size: 17px; }

#toast { opacity: 0; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--deep); color: var(--mint); padding: 11px 20px; border-radius: 999px; font-size: 15px; transition: transform .25s, opacity .25s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { #toast, .btn { transition: none; } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; padding: 6px; z-index: 40; justify-content: space-around; }
  .brand, .side .me, .nav .lbl-long { display: none; }
  .nav .lbl-short { display: inline; }
  .nav { display: contents; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 7px 4px; position: relative; flex: 1; border-radius: 14px; }
  .nav .badge { margin: 0; position: absolute; top: 2px; right: 6px; }
  .main { padding: 20px 14px 96px; }
  h1 { font-size: 28px; }
  .login { grid-template-columns: 1fr; }
  .login .r { display: none; }
  .grid3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .bitem { grid-template-columns: 66px 1fr; }
  .bitem .bact { grid-column: 1 / -1; }
  .week { font-size: 11px; }
}
