/* ============================================================
   DashboardCalendarTab — Outlook-Kalender im Dashboard
   ============================================================ */

.root {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* ── Status / Leer-Zustände ── */

.status {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  padding: 1rem 0;
}

.errorText {
  color: #ef4444;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
}

/* ── Nicht verbunden ── */

.notConnected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 0.5rem;
}

.notConnectedIcon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.notConnectedTitle {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.notConnectedSub {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
}

.notConnectedLink {
  color: var(--color-primary);
  text-decoration: none;
}

.notConnectedLink:hover {
  text-decoration: underline;
}

/* ── Toolbar ── */

.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;    /* Toolbar bleibt immer einzeilig */
  min-width: 0;
}

.navGroup {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;      /* Navigationsbuttons nie verkleinern */
}

.navBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.navBtn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.todayBtn {
  padding: 0.3125rem 0.875rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.todayBtn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.rangeLabel {
  flex: 1;
  min-width: 0;          /* Darf schrumpfen, nie viewToggle verdrängen */
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewToggle {
  display: flex;
  flex-shrink: 0;        /* Immer vollständig sichtbar */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.viewBtn {
  padding: 0.3125rem 0.875rem;
  background: var(--color-bg-card);
  border: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.viewBtn + .viewBtn {
  border-left: 1px solid var(--color-border);
}

.viewBtn:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.viewBtnActive {
  background: var(--color-primary);
  color: #fff;
}

.viewBtnActive:hover {
  color: #fff;
  opacity: 0.9;
}

/* ── Hauptbereich: Kalender + Agenda ── */

.content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.calendarPanel {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ── Monatsansicht ── */

.monthGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.monthWeekdayHdr {
  padding: 0.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dayCell {
  min-height: 88px;
  padding: 0.375rem 0.5rem;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.12s;
  overflow: hidden;
}

.dayCell:nth-child(7n) {
  border-right: none;
}

.dayCell:nth-last-child(-n+7) {
  border-bottom: none;
}

.dayCell:hover {
  background: rgba(59, 130, 246, 0.04);
}

.dayCellOther {
  background: var(--color-bg);
  opacity: 0.55;
}

.dayCellSelected {
  background: rgba(59, 130, 246, 0.07) !important;
  outline: 1px solid var(--color-primary);
  outline-offset: -1px;
}

.dayNum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text);
  border-radius: 50%;
  margin-bottom: 0.25rem;
}

.dayNumToday {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.dayCellEvents {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.eventChip {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #fff;
  border-radius: 2px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.eventMore {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  padding-left: 4px;
}

/* ── Wochenansicht (Mo–Fr) ── */

.weekGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* nur Arbeitstage */
}

.weekCol {
  padding: 0.5rem 0.375rem;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.12s;
  min-height: 320px;
}

.weekCol:last-child {
  border-right: none;
}

.weekCol:hover {
  background: rgba(59, 130, 246, 0.04);
}

.weekColSelected {
  background: rgba(59, 130, 246, 0.06) !important;
  outline: 1px solid var(--color-primary);
  outline-offset: -1px;
}

.weekColHdr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1875rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--color-border);
}

.weekColHdrToday .weekColNum {
  /* handled by weekColNumToday */
}

.weekColDay {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.weekColNum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: 50%;
}

.weekColNumToday {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.weekColEvents {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.weekEvent {
  padding: 0.25rem 0.375rem;
  background: var(--color-bg);
  border-left: 3px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.12s;
  overflow: hidden;
}

.weekEvent:hover {
  background: rgba(59, 130, 246, 0.07);
}

.weekEventTime {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 1px;
}

.weekEventSubj {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Agenda-Listenansicht (eigene View, 14 Tage) ── */

.agendaFullView {
  display: flex;
  flex-direction: column;
}

.agendaFullDay {
  display: flex;
  align-items: flex-start;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.1s;
}

.agendaFullDay:last-child {
  border-bottom: none;
}

.agendaFullDay:hover {
  background: rgba(59, 130, 246, 0.03);
}

.agendaFullDaySelected {
  background: rgba(59, 130, 246, 0.06) !important;
}

.agendaFullDayHdr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  flex-shrink: 0;
  padding: 0.875rem 0.5rem;
  gap: 0.125rem;
  border-right: 1px solid var(--color-border);
}

.agendaFullDayHdrToday .agendaFullNum {
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
}

.agendaFullWeekday {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.agendaFullNum {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agendaFullNumToday {
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
}

.agendaFullMonth {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}

.agendaFullEvents {
  flex: 1;
  padding: 0.625rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.agendaFullEmpty {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
}

.agendaFullEvent {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.625rem;
  border-left: 3px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
  background: var(--color-bg);
  transition: background 0.12s;
}

.agendaFullEvent:hover {
  background: rgba(59, 130, 246, 0.07);
}

.agendaFullEventTime {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
  min-width: 42px;
}

.agendaFullEventSubj {
  font-size: 0.875rem;
  color: var(--color-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Tages-Agenda (rechte Spalte) ── */

.agenda {
  width: 260px;
  flex-shrink: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Im Home-Sidebar: Agenda füllt volle Breite des Containers */
.agendaFull {
  width: 100%;
}

.agendaHeader {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.agendaWeekday {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agendaDateNum {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0.125rem;
}

.agendaEmpty {
  padding: 1.5rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  text-align: center;
}

.agendaList {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
}

.agendaItem {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid transparent;
  transition: background 0.12s;
}

.agendaItem:last-child {
  border-bottom: none;
}

.agendaItem:hover {
  background: rgba(59, 130, 246, 0.05);
}

.agendaTime {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.agendaSubject {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.agendaMeta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.125rem;
}

.onlineBadge {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 999px;
  padding: 0.0625rem 0.375rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ── Event-Detail-Modal ──────────────────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, var(--radius-md));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 520px;
  position: relative;
  padding: 1.75rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modalClose {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: all 0.15s;
}

.modalClose:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.modalTitle {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 2.25rem 0.5rem 0;
  line-height: 1.35;
}

.modalDateTime {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
}

.modalDateSep {
  color: var(--color-text-muted);
}

.modalLocation {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

/* ── Detailbox ── */

.modalDetails {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.875rem 0 1rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.detailRow {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.detailLabel {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 80px;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.detailValue {
  font-size: 0.875rem;
  color: var(--color-text);
}

.detailLink {
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
}

.detailLink:hover {
  text-decoration: underline;
}

.detailEmpty {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

.attendeeList {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.attendeeItem {
  font-size: 0.8125rem;
  color: var(--color-text);
  word-break: break-all;
}

/* ── Kontakt-Zuordnung ── */

.contactSection {
  margin-bottom: 1rem;
}

.contactSectionTitle {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.attendeeSuggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}

.attendeeChip {
  padding: 0.2rem 0.625rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attendeeChip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.attendeeChipActive {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 500;
}

.contactSearchWrap {
  margin-bottom: 0.375rem;
}

.contactSearchInput {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.contactSearchInput:focus {
  border-color: var(--color-primary);
}

.contactResultList {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
}

.contactResultItem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.75rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.1s;
}

.contactResultItem:hover {
  background: rgba(59, 130, 246, 0.06);
}

.contactResultItemSelected {
  background: rgba(59, 130, 246, 0.1);
  outline: 1px solid var(--color-primary);
  outline-offset: -1px;
}

.contactResultName {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contactResultMeta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.contactResultEmpty {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  padding: 0.5rem 0.75rem;
  font-style: italic;
}

.saveActivityBtn {
  width: 100%;
  padding: 0.5625rem 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.saveActivityBtn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.saveActivityBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.saveActivityBtnError {
  background: #ef4444;
}

.contactSectionSuccess {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #16a34a;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* ── Modal-Footer ── */

.modalFooter {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.875rem;
  border-top: 1px solid var(--color-border);
}

.outlookBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4375rem 1rem;
  background: none;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}

.outlookBtn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
