/* ===== Toolbar ===== */
.m365-inline-calendar .m365-cal-toolbar{
  display:flex; align-items:center; gap:8px; margin-bottom:12px;
}
.m365-inline-calendar .m365-cal-toolbar .title{
  flex:1; text-align:center; font-weight:700; font-size:18px;
}
.m365-inline-calendar .m365-cal-toolbar button{
  background:#fff; border:1px solid #d0d7de; color:#111; padding:6px 10px; border-radius:8px; cursor:pointer;
}
.m365-inline-calendar .m365-cal-toolbar button:hover{ background:#f3f4f6; }

/* ===== Grid / Kopfzeile ===== */
.m365-inline-calendar .m365-cal-grid{ display:flex; flex-direction:column; border:1px solid #e6e6e9; }
.m365-inline-calendar .row{ display:grid; grid-template-columns: repeat(7, 1fr); border-bottom:1px solid #e6e6e9; position:relative; }
.m365-inline-calendar .row:last-child{ border-bottom:none; }
.m365-inline-calendar .row.head .head-cell{
  padding:10px 8px; background:#fbfbfd; color:#58606a; font-weight:600; border-right:1px solid #e6e6e9;
}
.m365-inline-calendar .row.head .head-cell:last-child{ border-right:none; }

/* ===== Tageskacheln (fixe Größe) ===== */
.m365-inline-calendar .day-cell{
  min-height:108px; /* Höhe nach Wunsch anpassen */
  border-right:1px solid #e6e6e9; background:#fff; position:relative; padding:0;
}
.m365-inline-calendar .day-cell:last-child{ border-right:none; }
.m365-inline-calendar .day-cell.other{ background:#fafbfc; }
.m365-inline-calendar .day-cell.today{ background:#f6f9ff; }
.m365-inline-calendar .daynum{
  position:absolute; top:6px; right:6px;
  padding:0 6px; height:22px; display:flex; align-items:center;
  border-radius:999px; font-weight:600; color:#6b7280; background:#fff;
  border:1px solid #e5e7eb;
}

/* ===== Overlay-Layer über der Woche ===== */
.m365-inline-calendar .row.week .ovr{
  position:absolute; inset:0; display:grid; grid-template-columns:repeat(7,1fr);
  pointer-events:auto; /* Klicks auf Events erlaubt */
}

/* ===== Events (Overlay) – Allgemein ===== */
.m365-inline-calendar .ovr .ev{
  position:relative; align-self:start;
  display:flex; align-items:center;
  padding:2px 8px;
  height:22px;
  margin:0;
  border-radius:8px;
  border:1px solid transparent;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; /* Titel kürzen */
  color:#111; text-decoration:none;
  z-index:2;
}

/* Ein-Tages / getimte Events als Chips (1 Tag breit) */
.m365-inline-calendar .ovr .ev.ev-chip{ height:20px; }

/* Mehrtages-Balken: Kappen wie Outlook */
.m365-inline-calendar .ovr .ev.ev-span.cap-start{ border-top-left-radius:10px; border-bottom-left-radius:10px; }
.m365-inline-calendar .ovr .ev.ev-span.cap-end  { border-top-right-radius:10px; border-bottom-right-radius:10px; }

/* Wenn Event über Wochenrand hinausreicht -> flachere Kante */
.m365-inline-calendar .ovr .ev.ev-span.cap-cont-start{ border-top-left-radius:4px; border-bottom-left-radius:4px; }
.m365-inline-calendar .ovr .ev.ev-span.cap-cont-end  { border-top-right-radius:4px; border-bottom-right-radius:4px; }

/* ===== Fallback-Farbe (falls keine Kategorie) ===== */
.m365-inline-calendar .ovr .ev:not([class*="cat-"]){
  background:#eef1f6; border-color:#dde3eb; color:#1f2937;
}

/* ===== Kategorienfarben (Beispiele – bitte anpassen/erweitern) ===== */
.m365-inline-calendar .ovr .ev.cat-einladungswettkampf{ background:#A48FBC; border-color:#7D60A0; color:#644C80; }
.m365-inline-calendar .ovr .ev.cat-wettkampf-dsv  { background:#F8B279; border-color:#F69240; color:#C47433; }
.m365-inline-calendar .ovr .ev.cat-wettkampf-lsn { background:#B6CE87; border-color:#98B954; color:#799443; }
.m365-inline-calendar .ovr .ev.cat-wettkampf-bslg    { background:#80A4CF; border-color:#4A7EBB; color:#3B6495; }
.m365-inline-calendar .ovr .ev.cat-wettkampf-kreis     { background:#76C0C0; border-color:#3CA6A6; color:#308484; }
.m365-inline-calendar .ovr .ev.cat-vorstandssitzung { background:#ECECEC; border-color:#CFCFCF; color:#555555; }
.m365-inline-calendar .ovr .ev.cat-jahreshauptversammlung     { background:#FFE6F0; border-color:#FFC2D8; color:#8A2052; }

/* Hover */
.m365-inline-calendar .ovr .ev:hover{
  filter:brightness(.98);
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}

/* ===== Popup (native <dialog>) ===== */
.m365-dialog[open]{
  padding:16px 20px; border:1px solid #d0d7de; border-radius:12px; max-width:560px; background:#fff;
}
.m365-dialog::backdrop{ background:rgba(0,0,0,.25); }
.m365-dialog h3{ margin:8px 0 6px; font-size:18px; font-weight:700; }
.m365-dialog p{ margin:6px 0; }

.m365-dialog .cat-badge{
  display:inline-block; border-radius:999px; border:1px solid transparent; padding:2px 10px;
  font-size:12px; font-weight:700; margin-bottom:6px; color:#111; background:#eef1f6; border-color:#dde3eb;
}
/* gleiche Farben wie oben, damit Badge zur Eventfarbe passt */
.m365-dialog .cat-badge.cat-einladungswettkampf { background:#A48FBC; border-color:#7D60A0; color:#644C80; }
.m365-dialog .cat-badge.cat-wettkampf-dsv  { background:#F8B279; border-color:#F69240; color:#C47433; }
.m365-dialog .cat-badge.cat-wettkampf-lsn { background:#B6CE87; border-color:#98B954; color:#799443; }
.m365-dialog .cat-badge.cat-wettkampf-bslg    { background:#80A4CF; border-color:#4A7EBB; color:#3B6495; }
.m365-dialog .cat-badge.cat-wettkampf-kreis     { background:#76C0C0; border-color:#3CA6A6; color:#308484; }
.m365-dialog .cat-badge.cat-vorstandssitzung  { background:#ECECEC; border-color:#CFCFCF; color:#555555; }
.m365-dialog .cat-badge.cat-jahreshauptversammlung     { background:#FFE6F0; border-color:#FFC2D8; color:#8A2052; }

/* Popup: Ort-Link (Google Maps) */
.m365-dialog .dlg-row.location a{
  color:#0f6cbd; font-weight:600; text-decoration:none;
}
.m365-dialog .dlg-row.location a:hover{
  text-decoration:underline;
}

/* ===== Mobil ===== */
@media (max-width: 640px){
  .m365-inline-calendar .day-cell{ min-height:96px; }
  .m365-inline-calendar .ovr .ev{ height:20px; padding:2px 6px; }
  .m365-inline-calendar .daynum{ top:5px; right:5px; height:20px; font-size:12px; }
}
/* === HEUTE stärker hervorheben (ohne Layout zu verändern) === */
.m365-inline-calendar .day-cell.today{
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 55%);
  box-shadow:
    inset 0 0 0 2px #0f6cbd,      /* deutlicher Rahmen */
    inset 3px 0 0 0 #0f6cbd,      /* farbiger Akzent links */
    0 2px 10px rgba(15,108,189,.12);
}
.m365-inline-calendar .day-cell.today .daynum{
  background:#0f6cbd;
  color:#fff;
  border-color:#0a67b2;
  font-weight:800;
  transform: scale(1.06);
}

/* Events auf heutigem Tag minimal hervorheben (lesbar, ohne neue Farben) */
.m365-inline-calendar .day-cell.today .ovr .ev{
  box-shadow: 0 1px 4px rgba(15,108,189,.12);
}

/* === Mobile: Wochentagsnamen abkürzen (Mo. Di. Mi. Do. Fr. Sa. So.) === */
@media (max-width: 640px){
  .m365-inline-calendar .row.head .head-cell{
    position:relative;
    font-size:0;       /* Originaltext ausblenden, aber Platz behalten */
    padding:10px 6px;  /* etwas kompakter auf Mobile */
  }
  .m365-inline-calendar .row.head .head-cell::after{
    content:"";        /* wird je Spalte unten gesetzt */
    font-size:14px;
    font-weight:700;
    color:#58606a;
  }
  /* Kalender beginnt in DE i.d.R. mit Montag. Falls bei dir Sonntag zuerst ist,
     bitte die Zuordnung um eine Position verschieben. */
  .m365-inline-calendar .row.head .head-cell:nth-child(1)::after{ content:"Mo."; }
  .m365-inline-calendar .row.head .head-cell:nth-child(2)::after{ content:"Di."; }
  .m365-inline-calendar .row.head .head-cell:nth-child(3)::after{ content:"Mi."; }
  .m365-inline-calendar .row.head .head-cell:nth-child(4)::after{ content:"Do."; }
  .m365-inline-calendar .row.head .head-cell:nth-child(5)::after{ content:"Fr."; }
  .m365-inline-calendar .row.head .head-cell:nth-child(6)::after{ content:"Sa."; }
  .m365-inline-calendar .row.head .head-cell:nth-child(7)::after{ content:"So."; }
}
