/* Kalender (Paket N): Tag/Woche/Monat, Drag & Drop, Arbeitszeiten. Ergänzt workbench.css, nur kalender.html. */
.kal .wb-heading .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.kal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.kal-bar + .kal-bar { margin-top: 12px; }
.kal-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kal-seg button { border: 0; background: var(--card); padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.kal-seg button + button { border-left: 1px solid var(--line); }
.kal-seg button.active { background: var(--yellow); color: var(--ink, #1d1d1b); }
.kal-nav { display: inline-flex; gap: 6px; align-items: center; }
.kal-range { font-weight: 600; font-size: 15px; }
.kal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.kal-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--line); }
.kal-legend i.off { background: #e9e9e6; } .kal-legend i.abs { background: repeating-linear-gradient(45deg, var(--red-soft) 0 4px, #fff 4px 8px); border-color: #f3c9c5; }
.kal-legend i.warn { background: var(--yellow-soft); border-color: #f0c96a; }
#cal-message:empty { display: none; }
#cal-message { margin: 12px 0 0; padding: 10px 12px; border-radius: 6px; background: var(--yellow-soft); font-size: 13px; }

/* Termine (alle Ansichten) */
.kal .cal-event { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; position: relative; }
.kal .cal-event:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.kal .cal-event.done { opacity: .6; cursor: default; }
.kal .cal-event b { display: block; }
.kal .cal-event .ev-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.kal .cal-event .ev-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.kal .cal-event .ev-type { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--yellow-soft); color: #7a5a00; }
.kal .cal-event .ev-type.t-meeting { background: var(--blue-soft, #e6efff); color: var(--blue, #2f6fed); }
.kal .cal-event .ev-type.t-call { background: var(--green-soft, #e3f4ea); color: var(--green, #2e8b57); }
.kal .cal-event .ev-type.t-planning, .kal .cal-event .ev-type.t-todo, .kal .cal-event .ev-type.t-approve { background: #eef0ec; color: #55625a; }
.kal .cal-event .ev-cust { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.kal .cal-event .ev-sum { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.kal .cal-event small { margin: 4px 0 0; }
.kal .cal-event .warn { display: inline-block; margin-top: 4px; font-size: 11px; color: #8a5a00; background: var(--yellow-soft); border-radius: 4px; padding: 1px 6px; }
.kal .cal-event.dragging { opacity: .4; }
.kal .cal-event.t-meeting { border-left-color: var(--blue, #2f6fed); } .kal .cal-event.t-call { border-left-color: var(--green, #2e8b57); }
.kal-ghost { position: fixed; z-index: 80; pointer-events: none; width: 200px; max-width: 70vw; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--yellow); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 12px; transform: translate(-50%, -120%); }
.kal [data-date].over { outline: 2px dashed var(--yellow); outline-offset: -2px; background: var(--yellow-soft) !important; }

/* Woche */
.kal .cal-day h3 { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.kal .cal-day h3 small { font-weight: 400; color: var(--muted); font-size: 11px; }
.kal .cal-day.off { background: #ededea; }
.kal .cal-day.abs, .kal-month .m-cell.abs { background: repeating-linear-gradient(45deg, var(--red-soft) 0 6px, transparent 6px 14px); }
.kal-chip { display: inline-block; font-size: 10.5px; line-height: 1.5; padding: 0 6px; border-radius: 999px; background: var(--red-soft); color: var(--red); border: 1px solid #f3c9c5; margin: 0 4px 4px 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.kal-chip.hours { background: var(--card); color: var(--muted); border-color: var(--line); }

/* Tag */
.kal-dayview { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kal-dayhead { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); font-size: 13px; }
.kal-slot { display: grid; grid-template-columns: 58px minmax(0, 1fr); border-top: 1px solid var(--line); min-height: 40px; }
.kal-slot:first-of-type { border-top: 0; }
.kal-slot.half { border-top-style: dashed; }
.kal-slot > time { font-size: 11px; color: var(--muted); padding: 6px 8px; border-right: 1px solid var(--line); }
.kal-slot > div { padding: 4px 6px; min-width: 0; }
.kal-slot.off > div, .kal-slot.off > time { background: #ededea; }
.kal-slot .cal-event { margin: 2px 0; }

/* Monat */
.kal-month { margin-top: 16px; }
.kal-month .m-head, .kal-month .m-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kal-month .m-head span { font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 6px; text-transform: uppercase; }
.kal-month .m-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.kal-month .m-cell { min-height: 108px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.kal-month .m-cell.other { background: var(--bg); color: var(--muted); }
.kal-month .m-cell.off { background: #ededea; }
.kal-month .m-cell.today .m-no { background: var(--yellow); border-radius: 999px; }
.kal-month .m-cell.sel { box-shadow: inset 0 0 0 2px var(--ink, #1d1d1b); }
.kal-month .m-no { font-size: 12px; font-weight: 600; min-width: 22px; height: 22px; display: inline-grid; place-items: center; align-self: flex-start; }
.kal-month .m-ev { font-size: 11px; line-height: 1.35; padding: 2px 5px; border-radius: 4px; background: var(--yellow-soft); border-left: 3px solid var(--yellow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.kal-month .m-ev.t-meeting { background: var(--blue-soft); border-left-color: var(--blue, #2f6fed); } .kal-month .m-ev.t-call { background: var(--green-soft); border-left-color: var(--green, #2e8b57); }
.kal-month .m-ev.warn { box-shadow: inset 0 0 0 1px #f0c96a; }
.kal-month .m-more { font-size: 11px; color: var(--muted); }
.kal-month .m-dots { display: none; gap: 3px; flex-wrap: wrap; }
.kal-month .m-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow-text, #b07d00); }
.kal-month .m-dots i.t-meeting { background: var(--blue, #2f6fed); } .kal-month .m-dots i.t-call { background: var(--green, #2e8b57); }
.kal-daylist { margin-top: 16px; }
.kal-daylist h3 { font-size: 14px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kal-daylist .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 8px; border-radius: 8px; border: 1px dashed transparent; }

/* Dialog */
#cal-dialog .wb-form .three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kal-move-info { padding: 10px 12px; background: var(--bg); border-radius: 6px; font-size: 13px; line-height: 1.5; }
.kal-modes { display: grid; gap: 6px; }
.kal-modes label { display: flex !important; align-items: flex-start; gap: 8px; font-size: 13px !important; }
.kal-warning { padding: 10px 12px; border-radius: 6px; background: var(--yellow-soft); border: 1px solid #f0c96a; font-size: 13px; }
.kal-warning:empty { display: none; }
.kal-dlg-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Arbeitszeiten & Abwesenheiten */
.av-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.av-week { display: grid; gap: 6px; }
.av-day { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px 0; border-top: 1px solid var(--line); }
.av-day:first-child { border-top: 0; }
.av-day > b { font-size: 13px; padding-top: 8px; }
.av-blocks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.av-block { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; background: var(--card); max-width: 100%; }
.av-block input { border: 0; padding: 4px; font: inherit; font-size: 13px; background: transparent; color: var(--text); min-width: 0; width: 104px; }
.av-block button, .av-abs button.x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px; }
.av-free { font-size: 12px; color: var(--muted); }
.av-abs { display: grid; gap: 8px; }
.av-abs .row { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.av-abs .row small { display: block; color: var(--muted); }
.av-abs-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.av-abs-form label { font-size: 12px; display: grid; gap: 4px; }
.av-abs-form :is(input, select) { padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--card); color: var(--text); min-width: 0; }
.av-abs-form .full { grid-column: 1 / -1; }
.av-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.av-foot .ics { margin-left: auto; font-size: 12px; color: var(--muted); }
.av-team-wrap { overflow-x: auto; margin-top: 8px; }
.av-team { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 640px; }
.av-team th, .av-team td { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
.av-team th { color: var(--muted); font-weight: 600; }
.av-team td.off { background: #ededea; color: var(--muted); }
.av-team td.abs { background: var(--red-soft); color: var(--red); }

@media (max-width: 900px) { .av-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .kal-seg button { padding: 8px 10px; }
  .kal-bar > label { flex: 1 1 140px; }
  .kal-month .m-cell { min-height: 54px; padding: 3px; }
  .kal-month .m-ev, .kal-month .m-more { display: none; }
  .kal-month .m-dots { display: flex; }
  .kal-month .m-head span { padding: 4px 2px; text-align: center; }
  .kal-month .m-no { min-width: 20px; height: 20px; font-size: 11px; }
  .kal-daylist .list { grid-template-columns: 1fr; }
  #cal-dialog .wb-form .three { grid-template-columns: 1fr 1fr; }
  .av-day { grid-template-columns: 1fr; gap: 4px; }
  .av-day > b { padding-top: 0; }
  .av-abs-form { grid-template-columns: 1fr; }
  .av-foot .ics { margin-left: 0; }
}
.kal-month .m-ev b { font-weight: 700; }

/* Arbeitszeiten & Abwesenheiten: Übersichtskarten + Bearbeiten im Fenster */
.av-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.av-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--card); min-width: 0; }
.av-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.av-card-head h3 { margin: 0; font-size: 15px; }
.av-sum { display: grid; gap: 2px; }
.av-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.av-sum-row:first-child { border-top: 0; }
.av-sum-row span { color: var(--muted); }
.av-sum-row.free b { color: var(--muted); font-weight: 500; }
.av-card .ics { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.av-abs-list { display: grid; gap: 8px; }
.av-abs-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--yellow); border-radius: 6px; }
.av-abs-row.t-krank { border-left-color: var(--red, #d6453d); } .av-abs-row.t-sonstiges { border-left-color: #8da392; }
.av-abs-row.past { opacity: .65; }
.av-abs-row > div:first-child { min-width: 0; }
.av-abs-row b { display: block; font-size: 13.5px; }
.av-abs-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.av-abs-type { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--yellow-soft); color: #7a5a00; margin-bottom: 3px; }
.av-abs-row.t-krank .av-abs-type { background: var(--red-soft); color: var(--red); } .av-abs-row.t-sonstiges .av-abs-type { background: #eef0ec; color: #55625a; }
.av-abs-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.av-del { color: var(--red, #d6453d); }
.av-past { margin-top: 12px; } .av-past summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.av-dialog .av-foot { margin-top: 14px; }
@media (max-width: 900px) { .av-cards { grid-template-columns: 1fr; } }
.av-card-head .btn { white-space: nowrap; flex: none; }
