:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e4e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.1rem; } h3 { font-size: .95rem; }
p { margin: 0; }
.muted { color: var(--muted); font-size: .9em; }
.error { color: var(--danger); font-size: .9em; }
[hidden] { display: none !important; }

/* ---------- Bausteine ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: .55rem .95rem; border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef2f7; }
.btn.icon { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; font-size: 1.2rem; line-height: 1; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 500; color: #334155; }
input, select {
  font: inherit; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus { outline: 2px solid rgba(37, 99, 235, .35); border-color: var(--accent); }

.brand { display: flex; align-items: center; gap: .9rem; }
.brand.compact { gap: .6rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: #1e293b; position: relative; flex: none; }
.brand-mark::before { content: ""; position: absolute; inset: 10px 8px 8px; background: #fff; border-radius: 4px; }
.brand-mark::after { content: ""; position: absolute; left: 8px; right: 8px; top: 10px; height: 6px; background: var(--accent); border-radius: 4px 4px 0 0; }
.brand.compact .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.brand.compact .brand-mark::before { inset: 7px 6px 6px; }
.brand.compact .brand-mark::after { left: 6px; right: 6px; top: 7px; height: 4px; }
.logout { display: inline-flex; align-items: center; gap: .4rem; }
.logout-icon { display: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text small { font-size: .72rem; font-weight: 400; color: var(--muted); }

/* ---------- Login ---------- */
.screen { min-height: 100vh; }
#login { display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(100%, 380px); padding: 2rem; display: grid; gap: 1.1rem; }
.login-card .brand { margin-bottom: .4rem; }

/* ---------- App-Rahmen ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.25rem;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.company-badge { white-space: nowrap;
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border-radius: 999px;
  background: #f1f5f9; font-weight: 600; font-size: .9rem;
}

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem; max-width: 1400px; margin: 0 auto; align-items: start; }
.layout.has-panel { grid-template-columns: minmax(0, 1fr) 380px; }

/* ---------- Kalender ---------- */
.calendar { padding: 1.25rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-nav { display: flex; align-items: center; gap: .5rem; }
.month-label { display: grid; text-align: center; }
.month-label > span, .month-label::after { grid-area: 1 / 1; }
.month-label::after { content: "September 2026"; visibility: hidden; pointer-events: none; }
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { gap: 6px; margin-bottom: 6px; }
.weekdays span { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.grid { gap: 6px; }
.day {
  min-height: 108px; padding: .45rem; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.day:hover { border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.day.past { opacity: .55; }
.day.today .num { background: var(--accent); color: #fff; }
.day.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.day.weekend { background: #eef1f6; }
.day.holiday { background: #fdeef1; border-color: #f6d3da; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: .25rem; min-height: 24px; }
.today-label { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.holiday-name { font-size: .66rem; color: #b04a5e; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { margin-left: auto; font-size: .8rem; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.chip {
  font-size: .72rem; line-height: 1.25; padding: 2px 6px; border-radius: 6px; color: var(--ct, #fff); background: var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: .3rem; align-items: center;
}
.chip .time { font-weight: 700; }
.chip.more { background: #e2e8f0; color: #475569; justify-content: center; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend b { color: var(--text); font-weight: 600; }

/* ---------- Tages-Panel ---------- */
.day-panel { padding: 1.25rem; position: sticky; top: 76px; display: grid; gap: 1.1rem; max-height: calc(100vh - 100px); overflow: auto; }
.sheet-handle { display: none; }
.backdrop { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.timeline { display: grid; grid-template-columns: 44px repeat(var(--rooms, 2), minmax(0, 1fr)); gap: 0 6px; font-size: .78rem; }
.timeline .th { text-align: center; font-weight: 600; padding-bottom: .4rem; color: #334155; }
.timeline .th small { display: block; font-weight: 400; color: var(--muted); }
.timeline .th i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-right: .35rem; vertical-align: 1px; }
.timeline .hour { height: var(--h); color: var(--muted); font-size: .7rem; line-height: 1; transform: translateY(-.35em); }
.timeline .col { position: relative; border-radius: 8px; background: repeating-linear-gradient(to bottom, #f1f5f9 0, #f1f5f9 1px, transparent 1px, transparent var(--h)); border: 1px solid var(--line); overflow: hidden; }
.timeline .col .ev {
  position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 4px 6px; color: var(--ct, #fff); background: var(--c);
  overflow: hidden; line-height: 1.1; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  display: flex; align-items: baseline; gap: .35rem; white-space: nowrap;
}
.timeline .ev.short { padding-top: 0; padding-bottom: 0; align-items: center; }
.timeline .ev b { font-size: .72rem; flex: none; }
.timeline .ev span { font-size: .72rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; }
.timeline .ev.mine { outline: 2px solid var(--ct, #fff); outline-offset: -2px; padding-right: 24px; }
.timeline .ev button { position: absolute; top: 50%; right: 3px; transform: translateY(-50%); border: 0; background: color-mix(in srgb, var(--ct, #fff) 18%, transparent); color: var(--ct, #fff); border-radius: 5px; width: 18px; height: 13px; max-height: calc(100% - 2px); cursor: pointer; font-size: .75rem; line-height: 1; display: grid; place-items: center; }
.timeline .ev button:hover { background: color-mix(in srgb, var(--ct, #fff) 35%, transparent); }
.timeline .empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: .5rem 0 0; }

.book-form { display: grid; gap: .8rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.room-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.room-choice label { cursor: pointer; position: relative; }
.room-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.room-choice .opt { border-radius: 10px; padding: .65rem .8rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; background: var(--c); color: var(--ct, #fff); transition: filter .15s; }
.room-choice .opt b { font-weight: 600; }
.room-choice label:hover .opt { filter: brightness(1.06); }
.room-choice .opt .check { flex: none; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.room-choice input:checked + .opt .check { opacity: 1; transform: scale(1); }
.room-choice input:focus-visible + .opt { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); z-index: 20; }

/* ---------- Mobil ---------- */
@media (max-width: 1000px) {
  html, body { font-size: 14px; }
  .topbar { padding: .6rem .9rem; }
  .brand-text small { font-size: .68rem; }
  .company-badge { padding: .3rem .6rem; font-size: .85rem; }
  .btn.ghost { padding: .45rem .6rem; }
  .logout-text { display: none; }
  .logout-icon { display: block; }
  .logout { width: 38px; height: 38px; padding: 0; justify-content: center; }

  .layout, .layout.has-panel { grid-template-columns: 1fr; padding: .6rem; gap: .6rem; }
  .calendar { padding: .8rem .6rem; border-radius: 12px; }
  .cal-head { margin-bottom: .6rem; }
  .month-label { font-size: 1rem; }
  .weekdays, .grid { gap: 4px; }
  .weekdays span { font-size: .65rem; letter-spacing: .04em; }
  .day { min-height: 64px; padding: .25rem .3rem; border-radius: 8px; gap: 2px; }
  .day-head { min-height: 20px; }
  .num { width: 20px; height: 20px; font-size: .72rem; }
  .holiday-name, .today-label { display: none; }
  .chip { font-size: .6rem; padding: 1px 4px; border-radius: 4px; }
  .chip .txt { display: none; }
  .chip.more { font-size: .58rem; }
  .legend { margin-top: .6rem; padding-top: .6rem; font-size: .75rem; }

  /* Tages-Panel als Bottom-Sheet */
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 9; }
  body.panel-open { overflow: hidden; }
  .day-panel {
    position: fixed; inset: auto 0 0 0; top: 6vh; max-height: 94vh; border-radius: 18px 18px 0 0; z-index: 10;
    padding: .6rem 1rem calc(1rem + env(safe-area-inset-bottom)); gap: .9rem; box-shadow: 0 -8px 30px rgba(15, 23, 42, .25);
  }
  .sheet-handle { display: block; width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; margin: 0 auto; }
  .panel-head h2 { font-size: 1rem; }
  input, select { font-size: 16px; padding: .55rem .7rem; }
  .room-choice .opt { min-height: 46px; }
  .timeline { grid-template-columns: 40px repeat(var(--rooms, 2), minmax(0, 1fr)); }
  .timeline .ev b, .timeline .ev span { font-size: .7rem; }
}
