/* ============================================
   PROJEKTVERWALTUNG - KALENDER
   Modernes Kalender-Design
   Y-Achse: Projekte oder Mitarbeiter
   X-Achse: 31 Tage (1 Monat)
   ============================================ */

/* === HEADER === */
.header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(252, 252, 252, 0.86) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: var(--spacing-md) 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(14px);
  position: sticky;
  top: var(--news-ticker-height, 3.2rem);
  z-index: 150;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--calendar-gap);
  flex-wrap: wrap;
}

.header-title {
  display: flex;
  align-items: center;
  gap: var(--calendar-gap);
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1;
}

.header-title[role="button"] {
  cursor: pointer;
}

.header-title .logo {
  display: block;
  width: 6.4rem;
  height: auto;
  margin-right: 0;
}

.header-brand-text {
  font-size: clamp(2.2rem, 2vw, 3rem);
  letter-spacing: -0.03em;
}

.header-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-left: auto;
}

.mobile-menu-toggle {
  display: none;
  width: 4.4rem;
  height: 4.4rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.8rem;
  margin-left: auto;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 0.2rem;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(0.55rem) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-0.55rem) rotate(-45deg);
}

.auth-user-controls {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.auth-user-label {
  display: inline-flex;
  align-items: center;
  min-height: 3.4rem;
  padding: 0 var(--spacing-md);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-700);
}

.app-mode-toggle {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--gray-100);
  padding: 0.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.app-mode-toggle .btn {
  border-radius: 0;
  border: none;
  background: transparent;
  border-right: 1px solid var(--border);
  min-width: 10rem;
  transform: none;
  box-shadow: none;
}

.app-mode-toggle .btn:last-child {
  border-right: none;
}

/* === VIEW TOGGLE === */
.view-toggle {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.2rem;
  background: var(--gray-100);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.view-toggle .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  transform: none;
  box-shadow: none;
}

.view-toggle .btn:last-child {
  border-right: none;
}

.btn-toggle {
  position: relative;
}

.btn-toggle.active {
  background: var(--surface);
  color: var(--text);
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--primary);
  font-weight: 600;
}

.btn-toggle.active:hover {
  background: var(--surface);
  border-color: transparent;
}

.btn.is-active {
  background: var(--primary-50);
  border-color: var(--primary);
  color: var(--primary-dark);
}

#btnToggleDeletedProjects .toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#btnToggleDeletedProjects .toggle-label {
  white-space: nowrap;
}

/* === NAVIGATION EBENE 2 === */
.secondary-controls {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: var(--spacing-sm) 0;
  position: sticky;
  top: calc(var(--news-ticker-height, 3.2rem) + var(--header-height, 7rem));
  z-index: 130;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(14px);
}

.secondary-controls .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.secondary-controls-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.secondary-controls-left,
.secondary-controls-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.secondary-controls-right {
  margin-left: auto;
}

.news-ticker-bar {
  background: linear-gradient(90deg, #111827 0%, #1f2937 50%, #111827 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 160;
  margin-bottom: 0;
}

.news-ticker {
  position: relative;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.news-ticker::before {
  content: "NEWS";
  flex-shrink: 0;
  margin-right: 1rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.45rem;
  background: #f59e0b;
  color: #111827;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.news-ticker-track {
  display: inline-flex;
  align-items: center;
  color: #f9fafb;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  will-change: transform;
  animation: ticker-rtl 40s linear infinite;
}

.news-ticker-item {
  flex: 0 0 auto;
  margin-right: 5cm;
}

.news-ticker:hover .news-ticker-track,
.news-ticker:focus-visible .news-ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-rtl {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(calc(-100% - 1rem));
  }
}

/* === KALENDER CONTROLS === */
.calendar-controls {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: var(--spacing-md) 0;
  position: sticky;
  top: calc(var(--news-ticker-height, 3.2rem) + var(--header-height, 7rem) + var(--secondary-controls-height, 6rem));
  z-index: 120;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(14px);
}

.calendar-controls .container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.calendar-control-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  gap: var(--spacing-md);
}

.control-group {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  width: auto;
  flex: 0 0 auto;
}

.range-group {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.date-group {
  gap: var(--spacing-sm);
}

.status-group {
  justify-content: center;
}

.range-toggle,
.detail-toggle {
  display: grid;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.2rem;
  background: var(--gray-100);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.range-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(30rem, 100%);
  justify-self: center;
  justify-items: stretch;
  align-items: stretch;
}

.btn-today {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02));
  color: var(--text);
  font-weight: 700;
  border-right: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.btn-range {
  background: transparent;
}

.detail-toggle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(18rem, 100%);
  justify-self: center;
}

.detail-toggle.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.btn-range,
.btn-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  text-align: center;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  padding: 0.8rem 0.5rem;
  background: transparent;
  transform: none;
  line-height: 1.1;
}

.btn-range:last-child,
.btn-detail:last-child {
  border-right: none;
}

.btn-range.active,
.btn-detail.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--primary);
}

.btn-range:hover,
.btn-detail:hover {
  background: var(--gray-50);
}

.app-mode-toggle .btn:focus-visible,
.view-toggle .btn:focus-visible,
.range-toggle .btn:focus-visible,
.detail-toggle .btn:focus-visible {
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

.current-period {
  margin: 0;
  min-width: min(32rem, 100%);
  max-width: 42rem;
  justify-self: center;
  flex: 1 1 auto;
}

.current-period h2 {
  font-size: clamp(1rem, 0.95vw, 1.25rem);
  font-weight: 700;
  color: var(--text);
  margin: 0;
  min-width: 0;
  text-align: center;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
}

.current-period .period-week {
  display: block;
  font-size: 1.15em;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.8;
  line-height: 1.1;
}

.current-period .period-date {
  display: block;
  font-size: 2em;
  font-weight: 700;
  line-height: 1.1;
}

.controls-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  text-align: center;
}

/* === MAIN CONTENT === */
.main-content {
  padding: 0;
  min-height: calc(100vh - 20rem);
}

.main-content .container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.calendar-wrapper {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  border: none;
}

.focus-view {
  padding: var(--spacing-lg);
  background: transparent;
}

.focus-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.focus-view-title {
  margin: 0;
  font-size: clamp(2rem, 1.5vw, 2.6rem);
}

.focus-view-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.focus-view-kpis {
  display: inline-flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.focus-kpi {
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: var(--font-size-sm);
}

.focus-empty {
  padding: var(--spacing-lg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
}

.settings-fab {
  position: fixed;
  left: 1.6rem;
  bottom: 1.6rem;
  z-index: 120;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 999px;
  padding: 0;
  box-shadow: var(--shadow-lg);
}

.notification-bell-wrap {
  position: relative;
  display: inline-flex;
}

#btnNotificationBell {
  position: relative;
}

.notification-bell-badge {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  min-width: 1.8rem;
  height: 1.8rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 32rem;
  max-width: calc(100vw - 2rem);
  max-height: 40rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 160;
}

.notification-dropdown-header {
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.notification-dropdown-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--gray-100);
}

.notification-item-title {
  font-weight: 600;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.notification-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.notification-item-icon.is-approved {
  background: #27ae60;
}

.notification-item-icon.is-rejected {
  background: #c0392b;
}

.notification-item-meta {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.notification-empty {
  padding: 1.2rem;
  color: var(--text-muted);
  text-align: center;
}

.assignment-approval-banner {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  font-weight: 500;
  margin-top: 0.4rem;
}

.assignment-approval-banner.is-pending {
  background: rgba(17, 17, 17, 0.06);
  border: 1px dashed rgba(17, 17, 17, 0.35);
}

.assignment-approval-banner.is-rejected {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.4);
  color: #922b21;
}

.modal-settings-content {
  max-width: 78rem;
  width: min(78rem, calc(100vw - 3.2rem));
  height: min(78vh, 82rem);
  max-height: min(78vh, 82rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-settings-content .modal-header {
  flex: 0 0 auto;
}

.modal-settings-content .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.settings-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  border-bottom: 1px solid var(--border);
  padding: 0 0.2rem;
  margin-bottom: 1.2rem;
}

.settings-tab-btn {
  border: 1px solid var(--border);
  border-bottom: none;
  background: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-200) 100%);
  color: var(--text-muted);
  padding: 0.65rem 1.2rem;
  border-radius: 0.75rem 0.75rem 0 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  top: 1px;
}

.settings-tab-btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, var(--gray-100) 100%);
  color: var(--text);
}

.settings-tab-btn.is-active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  z-index: 1;
}

.settings-tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--surface);
}

.settings-tab-panel {
  display: block;
}

.settings-tab-panel[hidden] {
  display: none;
}

.modal-settings-content .modal-body::-webkit-scrollbar {
  width: 1rem;
}

.modal-settings-content .modal-body::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 1rem;
}

.modal-settings-content .modal-body::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 1rem;
  border: 2px solid var(--gray-100);
}

.modal-settings-content .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.settings-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-section-header h4 {
  margin: 0;
  font-size: var(--font-size-base);
}

.settings-section-header p {
  margin: 0 0 0.6rem 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.settings-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.settings-status-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  background: var(--surface);
}

.settings-status-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.settings-status-meta {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.settings-status-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.settings-projectleader-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  align-items: stretch;
}

.projectleader-topline {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.projectleader-name {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text);
}

.projectleader-code-badge {
  font-weight: 700;
}

.projectleader-bottomline {
  margin-left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(12rem, 1fr));
  align-items: center;
  gap: 0.6rem;
}

.projectleader-password-input {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
  max-width: none;
}

.projectleader-action-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 980px) {
  .projectleader-bottomline {
    grid-template-columns: 1fr;
  }

  .projectleader-password-input {
    min-width: 0;
    width: 100%;
  }

  .projectleader-action-btn {
    width: 100%;
  }
}

.settings-status-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.settings-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
}

.settings-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 3.8rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--gray-300);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.settings-checkbox input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease;
}

.settings-checkbox input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary-dark);
}

.settings-checkbox input[type="checkbox"]:checked::after {
  transform: translateX(1.6rem);
}

.settings-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.settings-checkbox-label {
  color: var(--text);
}

.assignment-provisional-group {
  gap: 0.5rem;
}

.assignment-provisional-group .form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.assignment-status-caption {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.settings-provisional-preview {
  border: 2px solid var(--provisional-entry-color, #dcdcdc);
  background: var(--provisional-entry-color, #dcdcdc);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #111111;
  min-height: 3.2rem;
  display: flex;
  align-items: center;
}

.settings-badges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.2rem;
}

.data-transfer-actions {
  display: grid;
  grid-template-columns: minmax(20rem, auto) 1fr;
  gap: var(--spacing-md);
  align-items: center;
}

.data-transfer-actions .form-input {
  min-height: 4.2rem;
}

@media (max-width: 768px) {
  .data-transfer-actions {
    grid-template-columns: 1fr;
  }
}

.assignment-type-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 0.7rem;
  font-size: var(--font-size-xs);
  margin-left: 0.4rem;
  color: var(--text-muted);
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
  gap: var(--spacing-md);
}

.today-card {
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: 1.1rem;
  background: linear-gradient(160deg, #ffffff 0%, #f8f8f8 100%);
  padding: var(--spacing-md);
}

.today-card-employee {
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.today-card-assignments {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.today-assignment {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  background: rgba(17, 17, 17, 0.03);
  border-radius: 0.6rem;
}

.today-project-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
}

.today-project-name {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.today-unassigned {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
}

.today-unassigned h3 {
  margin-bottom: 0.8rem;
}

.today-unassigned-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.today-unassigned-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-700);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.project-list-quick-picker {
  min-width: 24rem;
}

.project-list-toolbar {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(12rem, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.project-list-summary {
  margin-bottom: var(--spacing-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.project-list-summary strong {
  color: var(--text);
}

.project-list-table {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-list-head,
.project-list-row {
  display: grid;
  grid-template-columns: minmax(22rem, 2fr) repeat(4, minmax(12rem, 1fr)) minmax(7rem, auto) minmax(2rem, auto);
  gap: 0.7rem;
  align-items: center;
}

.project-list-head {
  padding: 0 0.6rem;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-list-sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0;
}

.project-list-sort-btn:hover {
  color: var(--text);
}

.project-list-sort-btn.is-active {
  color: var(--primary-dark);
}

.project-list-sort-indicator {
  min-width: 1rem;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.6;
}

.project-list-sort-btn.is-active .project-list-sort-indicator {
  opacity: 1;
}

.project-list-row {
  padding: 1.2rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(180deg, #fff 0%, #fcfcfc 100%);
}

.project-list-row:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

.project-list-row.is-deleted {
  opacity: 0.75;
  background: linear-gradient(180deg, #fafafa 0%, #f2f2f2 100%);
}

.project-priority-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.priority-manual-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  opacity: 0.45;
  font-size: 1.2rem;
}

.priority-manual-flag:empty {
  display: none;
}

.priority-manual-flag.is-visible {
  color: #b45309;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  opacity: 1;
}

.priority-mode-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.priority-mode-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.2rem 0.8rem;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--gray-100);
}

.priority-mode-badge.is-manual {
  color: #b45309;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.16);
}

.btn-sm {
  padding: 0.5rem 0.9rem;
  font-size: var(--font-size-xs);
}

.project-list-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.project-open-edit {
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-open-edit:hover {
  color: var(--primary-dark);
}

.project-list-name small {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-team-count {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--gray-100);
  font-weight: 600;
}

.project-leader-badge,
.project-leader-badge-inline,
.project-leader-badge-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(17, 17, 17, 0.16);
  flex-shrink: 0;
}

.project-leader-badge-inline {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.80rem;
  margin-left: 25px;
}

.project-leader-badge-cell {
  margin-right: 0.4rem;
}

.project-leader-badge__initials {
  line-height: 1;
}

.project-leader-select {
  min-width: 10rem;
}

.row-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  min-height: 100%;
}

.row-header-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  justify-content: center;
  align-items: flex-start;
}

/* === KALENDER GRID === */
.calendar {
  overflow: visible;
  position: relative;
  width: 100%;
  max-height: none;
}

.calendar-shell {
  display: flex;
  flex-direction: column;
  min-width: max-content;
  width: 100%;
}

.calendar-header-wrap {
  position: sticky;
  top: var(--top-stack-height, 0px);
  z-index: 110;
  overflow: hidden;
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.calendar-header-wrap::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.calendar-body-wrap {
  overflow: visible;
  width: 100%;
  max-height: none;
}

.calendar-grid {
  display: grid;
  /* Wird dynamisch via JavaScript gesetzt für 2-Wochen-Ansicht */
  grid-template-columns: 16rem repeat(14, minmax(0, 1fr));
  min-width: max-content;
  width: 100%;
  border-collapse: collapse;
}

.calendar-grid.range-year.year-fullwidth {
  min-width: 100%;
}

.calendar:has(.calendar-grid.range-year.year-fullwidth) .calendar-shell {
  min-width: 100%;
}

.calendar:has(.calendar-grid.range-year.year-fullwidth) .calendar-header-wrap,
.calendar:has(.calendar-grid.range-year.year-fullwidth) .calendar-body-wrap,
.calendar:has(.calendar-grid.range-year.year-fullwidth) .calendar-grid.range-year.year-fullwidth {
  width: 100%;
}

.calendar-grid.short-range-fullwidth {
  min-width: 100%;
}

/* === HEADER ROW === */
.calendar-header {
  display: contents;
}

.calendar-header > div {
  background: var(--gray-100);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
  padding: var(--spacing-md);
  font-weight: 600;
  text-align: center;
  position: relative;
  z-index: 70;
}

.calendar-row-header {
  position: sticky;
  left: 0;
  z-index: 30;
  background: var(--gray-50);
  border-right: 2px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-md);
  font-weight: 600;
  color: var(--text);
  font-size: var(--font-size-base);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--spacing-xs);
  min-height: 8rem;
  transition: background 0.2s ease;
}

.calendar-row-header[draggable="true"] {
  cursor: move;
  cursor: grab;
}

.calendar-row-header[draggable="true"]:active {
  cursor: grabbing;
}

.calendar-row-header.dragging {
  opacity: 0.4;
}

.calendar-row-header.drag-over {
  border-top: 3px solid var(--primary);
  margin-top: -3px;
}

.calendar-row-header.deleted-project {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  color: var(--gray-600);
  opacity: 0.85;
  border-left-style: dashed;
}

.calendar-row-header.deleted-project .row-header-content::after {
  content: "Gelöscht";
  display: inline-flex;
  align-self: flex-start;
  margin-top: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--gray-300);
  color: var(--gray-700);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.calendar-header .calendar-row-header {
  top: auto;
  left: 0;
  background: var(--gray-100);
  text-align: center;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 71;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: auto;
}
/* === STATUSFARBEN === */
/* q 
.geplant {

}

.aktiv {

}

.pausiert {

}

.abgeschlossen {

}
*/ d

.calendar-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  min-height: 8rem;
  transition: all 0.2s ease;
}

.calendar-grid.range-month .calendar-day-header {
  padding: 0.6rem 0.2rem;
  min-height: 5.4rem;
  gap: 0.2rem;
}

.calendar-grid.range-month .day-name {
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.calendar-grid.range-month .day-number {
  font-size: 1.6rem;
}

.calendar-grid.range-year .calendar-day-header {
  padding: 0.8rem 0.3rem;
  min-height: 4.8rem;
}

.calendar-grid.range-year .calendar-day-header.year-month-header {
  cursor: pointer;
}

.calendar-grid.range-year .calendar-day-header.year-month-header:hover {
  background: var(--primary-50);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.calendar-grid.range-year .day-name {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.calendar-grid.range-year .day-week {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.calendar-grid.range-year .calendar-day-header.today .day-week {
  color: rgba(255, 255, 255, 0.92);
}

.calendar-grid.range-year .calendar-day-header.current-month {
  background: var(--primary-100);
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--primary), inset 0 0 0 1px rgba(239, 139, 35, 0.25);
}

.calendar-grid.range-year .calendar-day-header.current-month .day-name {
  color: var(--text);
  font-weight: 700;
}

.calendar-grid.range-year .calendar-day-header.current-month .day-week {
  color: var(--primary-dark);
}

.calendar-grid.range-year .calendar-day-header.current-month.year-month-header:hover {
  background: var(--primary-light);
}

.calendar-day-header.today {
  background: var(--primary);
  color: white;
}

.calendar-day-header.weekend {
  background: var(--gray-200);
  /* color: var(--text-muted); */
}

.day-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.day-number {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1;
}

/* === KALENDER ROWS === */
.calendar-row {
  display: contents;
}

.calendar-row:hover .calendar-row-header {
  background: var(--primary-50);
}

.row-header-name {
  font-size: var(--font-size-sm);
  line-height: 1.4;
  word-wrap: break-word;
  width: 100%;
}

.row-header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  word-wrap: break-word;
  text-align: left;
}

.row-header-info {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
}

.row-header-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: var(--spacing-xs);
}

.btn-delete-row {
  padding: 0.3rem 0.5rem;
  font-size: 1.1rem;
  background: var(--gray-200);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-delete-row:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  transform: scale(1.05);
}

/* === KALENDER ZELLEN === */
.calendar-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-xs);
  min-height: 8rem;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.calendar-cell:hover {
  background: var(--gray-50);
  box-shadow: inset 0 0 0 2px var(--primary-light);
}

.calendar-cell.weekend {
  background: var(--gray-50);
}

.calendar-cell.weekend:hover {
  background: var(--gray-100);
}

.calendar-cell.today {
  background: var(--primary-50);
  /* border-color: var(--primary);  */
}

/* .calendar-cell.today::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
} */



/* Projektdauer-Hintergrund in Projektansicht */
.calendar-cell.project-duration {
  border-top: 3px solid var(--primary);
  background-color: var(--gray-100); 
}

.calendar-cell.project-duration.weekend {
  border-top: 3px solid var(--primary);
  /* background-color: var(--gray-100); */
}

.calendar-grid.range-month.view-projekte .calendar-cell.project-duration {
  background: linear-gradient(
    180deg,
    rgba(239, 139, 35, 0.22) 0%,
    rgba(239, 139, 35, 0.1) 42%,
    rgba(239, 139, 35, 0.04) 100%
  );
  border-top-color: rgba(239, 139, 35, 0.95);
}

.calendar-grid.range-week .calendar-cell,
.calendar-grid.range-fortnight .calendar-cell {
  min-height: 5.8rem;
  padding: 0.4rem;
}

.calendar-grid.range-week .calendar-row-header,
.calendar-grid.range-fortnight .calendar-row-header {
  min-height: 5.8rem;
  padding: 0.8rem;
}

.calendar-grid.range-month .calendar-cell {
  min-height: 5.8rem;
  padding: 0.4rem;
}

.calendar-grid.range-month .calendar-row-header {
  min-height: 5.8rem;
  padding: 0.8rem;
}

.calendar-grid.range-year .calendar-cell {
  min-height: 5rem;
  padding: 0.35rem;
}

.calendar-grid.range-year .calendar-row-header {
  min-height: 5rem;
  padding: 0.75rem;
}

.year-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.year-project-week-detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

.year-week-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.12rem;
  width: 100%;
}

.year-week-segment {
  height: 0.48rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.12);
}

.year-week-segment.active {
  background: rgba(239, 139, 35, 0.92);
}

.year-week-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.12rem;
}

.year-week-count {
  min-height: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1;
}

.year-project-duration {
  background: linear-gradient(
    180deg,
    rgba(239, 139, 35, 0.2) 0%,
    rgba(239, 139, 35, 0.08) 100%
  );
}

.year-project-bar {
  width: 100%;
  height: 0.65rem;
  border-radius: 999px;
  opacity: 0.9;
}

.year-assignment-hint {
  position: absolute;
  right: 0.35rem;
  bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 1.8rem;
  text-align: center;
  padding: 0.05rem 0.45rem;
}

.year-employee-assignments {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  align-items: stretch;
  overflow: hidden;
}

.year-project-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.year-project-row-name {
  display: inline-block;
  max-width: 100%;
  padding: 0.06rem 0.3rem;
  border-left: 3px solid var(--primary);
  border-radius: 0.3rem;
  background: rgba(17, 17, 17, 0.06);
  font-size: 0.88rem;
  color: var(--gray-800);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-assignment-more {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  align-self: flex-end;
}

.year-empty-weeks {
  justify-content: center;
}

.cell-content {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  height: 100%;
  width: 100%;
}

.month-project-overview {
  justify-content: flex-end;
}

.month-project-overview-normal {
  justify-content: center;
}

.month-assignee-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  align-self: flex-end;
  opacity: 0.72;
}

.month-assignee-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.14);
}

.month-assignee-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.14);
}

.month-assignee-more {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.month-assignee-labels {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
}

.month-assignee-label {
  display: inline-block;
  max-width: 8.8rem;
  padding: 0.08rem 0.35rem;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--gray-800);
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-assignment-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

/* === EINTRÄGE IN ZELLEN === */

/* Standard-Eintrag: Mitarbeiter (wenn Y-Achse = Projekte) */
.cell-entry {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  color: #111111;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  margin: 0 0 0.28rem 0;
  box-shadow: none;
  border: 2px solid rgba(17, 17, 17, 0.16);
  background-color: #f0efef;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  min-height: 2.6rem;
}

.entry-delete {
  opacity: 0.8;
  font-size: 1.6rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0 0.4rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #111111;
  margin-left: auto;
  position: relative;
  z-index: 2;
}

.cell-entry:hover .entry-delete {
  opacity: 0.9;
}

.entry-delete:hover {
  opacity: 1 !important;
  transform: scale(1.1);
}

.cell-entry:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  background-color: #dcdcdc;
}

/* Genehmigungspflichtige Zuweisungen (Projektleiter-Eintrag, noch nicht durch Disponent bestaetigt) */
.cell-entry[data-genehmigung="ausstehend"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(17, 17, 17, 0.28) 0,
    rgba(17, 17, 17, 0.28) 2px,
    transparent 2px,
    transparent 9px
  );
  z-index: 1;
}

.cell-entry[data-genehmigung="abgelehnt"] {
  outline: 2px dashed #c0392b;
  outline-offset: -2px;
}

/* Projekt-Eintrag (wenn Y-Achse = Mitarbeiter) */
/* Hier wird der Projektname angezeigt, nicht der Mitarbeitername */
.cell-entry.project-entry {
  padding: 0.5rem 0.7rem;
  font-size: 1.4rem;
  min-height: 2.8rem;
  font-weight: 500;
  margin: 0 0 0.28rem 0;
}

.calendar-grid.range-month.view-mitarbeiter .cell-entry.project-entry {
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
  font-size: 1.05rem;
}

.calendar-grid.range-month.view-mitarbeiter .entry-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.calendar-grid.range-month.view-mitarbeiter .entry-delete {
  font-size: 1.2rem;
  padding: 0 0.2rem;
}

.entry-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.3;
  display: block;
}

.entry-text-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  min-width: 0;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.entry-notes {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  line-height: 1.2;
}

/* === ZUSAMMENHÄNGENDE EINTRÄGE === */

/* Start eines zusammenhängenden Eintrags */
.cell-entry.entry-start {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -1px;
  padding-right: 0.2rem;
  min-height: 2.4rem;
  width: calc((var(--multi-day-span, 1) * 100%) - 1px);
  max-width: none;
  z-index: 4;
  position: relative;
}

.cell-entry.entry-start.entry-span {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  margin-right: 0;
}

.calendar-cell.multi-day-overflow {
  overflow: visible;
}

.calendar-cell.multi-day-overflow .cell-content {
  overflow: visible;
}

.calendar-cell.multi-day-overflow .cell-entry.entry-start {
  overflow: hidden;
  position: relative;
  z-index: 4;
}

.calendar-cell.multi-day-overflow .cell-entry.entry-start .entry-text-wrapper,
.calendar-cell.multi-day-overflow .cell-entry.entry-start .entry-name,
.calendar-cell.multi-day-overflow .cell-entry.entry-start .entry-notes {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mitte eines zusammenhängenden Eintrags */
.cell-entry.entry-middle {
  border-radius: 0;
  margin-left: -1px;
  margin-right: -1px;
  border-top-width: 2px;
  border-bottom-width: 2px;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.cell-entry.entry-middle-two-day {
  border-radius: 0;
  margin-left: -1px;
  margin-right: -1px;
  border-top-width: 2px;
  border-bottom-width: 2px;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

/* Ende eines zusammenhängenden Eintrags */
.cell-entry.entry-end {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
  padding-left: 0.2rem;
  min-height: 2.4rem;
}

/* Zusammenhängende Einträge haben einen durchgehenden Look */
.cell-entry[data-assignment-group]:not(.entry-single) {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  align-self: stretch;
}

/* Hover-Effekt für die ganze Gruppe */
.cell-entry[data-assignment-group][draggable="true"] {
  cursor: move;
  cursor: grab;
}

.cell-entry[data-assignment-group][draggable="true"]:active {
  cursor: grabbing;
}

/* Visuelles Feedback beim Ziehen */
.cell-entry.dragging-assignment {
  opacity: 0.5;
  transform: scale(0.98);
}

/* Drop-Target Visualisierung */
.calendar-cell.drop-target {
  background-color: var(--primary-50) !important;
  box-shadow: inset 0 0 0 2px var(--primary) !important;
}

/* Projektname in Mitarbeiter-Ansicht (größer und deutlicher) */
.cell-entry.project-entry .entry-name {
  font-weight: 600;
  font-size: 1.3rem;
}

/* Mehrfach-Zuweisungen: Stapelung */
.cell-content.has-multiple .cell-entry {
  margin-bottom: 0.25rem;
}

.cell-content.has-multiple .cell-entry:last-child {
  margin-bottom: 0;
}

/* Kompakte Ansicht für viele Einträge (>3) */
.calendar-cell.has-many-entries .cell-entry {
  padding: 0.3rem 0.5rem;
  font-size: 1.1rem;
  min-height: 2rem;
}

.calendar-empty {
  padding: var(--spacing-2xl);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.calendar-legend {
  grid-column: 1 / -1;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.legend-pill-deleted {
  background: var(--gray-200);
  color: var(--gray-700);
}

.calendar-empty svg {
  width: 6rem;
  height: 6rem;
  opacity: 0.3;
}

.loading {
  padding: var(--spacing-2xl);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

/* === AUTH OVERLAY === */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background:
    radial-gradient(circle at 15% 15%, rgba(239, 141, 37, 0.24), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(17, 17, 17, 0.18), transparent 26%),
    linear-gradient(155deg, #f8f6f0 0%, #f2ede1 100%);
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

.auth-overlay.active {
  display: flex;
}

.auth-card {
  width: 100%;
  max-width: 42rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.6rem;
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
}

.auth-card h2 {
  margin-bottom: var(--spacing-sm);
}

.auth-card-subtitle {
  margin-bottom: var(--spacing-lg);
  color: var(--text-muted);
}

.auth-form .auth-submit {
  width: 100%;
}

.auth-error-message {
  margin-top: var(--spacing-sm);
  margin-bottom: 0;
  color: #b42318;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.auth-help-text {
  margin-top: var(--spacing-md);
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* === MODALS === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  overflow-y: auto;
  padding: var(--spacing-lg);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 60rem;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(2rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  background: var(--gray-50);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
  border-radius: var(--radius);
}

.modal-close:hover {
  color: var(--text);
  background: var(--gray-200);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  padding-top: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  border-top: 1px solid var(--border);
}

/* === SCROLLBAR STYLING === */
.calendar::-webkit-scrollbar {
  height: 1.2rem;
  width: 1.2rem;
}

.calendar::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: var(--radius);
}

.calendar::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius);
  border: 2px solid var(--gray-100);
}

.calendar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

.calendar::-webkit-scrollbar-corner {
  background: var(--gray-100);
}

/* === TOAST NOTIFICATIONS === */
.toast {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  background: var(--surface);
  color: var(--text);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  min-width: 25rem;
  max-width: 40rem;
  animation: slideInRight 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  justify-content: space-between;
}

.toast-message {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.toast-action {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.toast-action:hover {
  color: var(--primary);
}

.toast.success {
  border-left-color: #10b981;
}

.toast.error {
  border-left-color: #dc2626;
}

.toast.info {
  border-left-color: var(--primary);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .calendar-grid {
    grid-template-columns: 20rem repeat(31, 7rem);
  }
  
  .calendar-row-header {
    min-height: 8rem;
  }
  
  .calendar-cell {
    min-height: 8rem;
  }
}

@media (min-width: 769px) and (max-width: 999px) {
  .calendar-grid {
    grid-template-columns: 15rem repeat(14, minmax(5.6rem, 1fr));
  }

  .calendar-row-header {
    font-size: var(--font-size-sm);
    min-height: 6rem;
    padding: var(--spacing-sm);
  }

  .calendar-cell {
    min-height: 6rem;
    padding: 0.4rem;
  }

  .cell-entry {
    font-size: 1.1rem;
    padding: 0.3rem 0.4rem;
    min-height: 2rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .header {
    position: sticky;
    top: var(--news-ticker-height, 3.2rem);
  }

  .header .container {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
  }

  .header-title {
    padding: 15px 0;
    flex: 1 1 auto;
  }

  .header-actions {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-left: 0;
    padding-top: var(--spacing-sm);
  }

  body.mobile-menu-open .header-actions,
  body.mobile-menu-open .secondary-controls,
  body.mobile-menu-open .calendar-controls {
    display: flex;
  }

  .secondary-controls {
    display: none;
  }

  .calendar-controls {
    display: none;
  }

  .secondary-controls .container {
    align-items: stretch;
  }

  .secondary-controls-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .secondary-controls-left,
  .secondary-controls-right {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .secondary-controls-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-xs);
  }
  
  .view-toggle {
    width: 100%;
  }

  .app-mode-toggle {
    width: 100%;
  }

  .app-mode-toggle .btn {
    flex: 1;
    min-width: 0;
  }
  
  .view-toggle .btn {
    flex: 1;
  }
  
  .btn {
    width: auto;
    justify-content: center;
  }

  .secondary-controls-right > .btn,
  .calendar-controls > .container > .btn,
  .calendar-controls #btnToday {
    width: 100%;
  }
  
  .calendar-control-bar {
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-sm);
  }

  .control-group {
    width: 100%;
  }

  .calendar-controls .container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .controls-group {
    display: flex;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
  }

  .controls-group > .btn-icon {
    width: 3.4rem;
    height: 3.4rem;
  }

  .range-toggle {
    width: 100%;
  }

  .range-toggle .btn-range {
    flex: 1;
  }

  .detail-toggle {
    width: 100%;
  }

  .detail-toggle .btn-detail {
    flex: 1;
  }

  .project-list-toolbar {
    grid-template-columns: 1fr;
  }

  .project-list-quick-picker {
    width: 100%;
    min-width: 0;
  }

  .project-list-head {
    display: none;
  }

  .project-list-row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .project-priority-cell {
    width: 100%;
  }

  .project-priority-cell .form-input {
    flex: 1;
  }

  .priority-mode-controls {
    flex-wrap: wrap;
  }

  .project-team-count {
    justify-content: flex-start;
    padding: 0 0.8rem;
    width: fit-content;
  }
  
  .current-period {
    margin: 0;
  }
  
  .controls-info {
    justify-content: center;
    width: 100%;
  }

  .calendar-grid {
    grid-template-columns: 15rem repeat(31, 5.6rem);
  }
  
  .calendar-row-header {
    font-size: var(--font-size-sm);
    min-height: 6rem;
    padding: var(--spacing-sm);
  }
    
  .calendar-cell {
    min-height: 6rem;
    padding: 0.4rem;
  }
  
  .cell-entry {
    font-size: 1.1rem;
    padding: 0.3rem 0.4rem;
    min-height: 2rem;
  }
  
  .cell-entry.project-entry {
    font-size: 1.2rem;
    padding: 0.4rem 0.5rem;
  }
  
  .cell-content {
    gap: 0.2rem;
  }
  
  .modal {
    padding: var(--spacing-sm);
  }
  
  .modal-content {
    max-width: 100%;
  }

  .modal-settings-content {
    width: 100%;
    height: min(86vh, 82rem);
    max-height: min(86vh, 82rem);
  }
}

@media (max-width: 480px) {

  .calendar-header-wrap {
    position: relative;
    top: auto;
  }

  .news-ticker-bar {
    top: 0;
    position: sticky;
  }

  .calendar-controls {
    top: auto;
    position: relative;
    padding: var(--spacing-sm) 0;
  }

  .secondary-controls {
    top: auto;
    position: relative;
    margin-top: 30px;

  }

  .header {
    padding: var(--spacing-sm) 0;
  }

  .calendar-header > div,
  .calendar-header .calendar-row-header {
    top: 0;
  }

  .header-title .logo {
    width: 4.8rem;
  }

  .header-brand-text {
    font-size: 2.2rem;
  }

  .secondary-controls-right > .btn,
  .calendar-controls > .container > .btn,
  .calendar-controls #btnToday {
    width: 100%;
  }

  .controls-info {
    display: none;
  }
  
  .current-period h2 {
    font-size: var(--font-size-lg);
    min-width: auto;
  }
  
  .day-name {
    font-size: 1rem;
  }
  
  .day-number {
    font-size: var(--font-size-lg);
  }
  
  .calendar-grid {
    grid-template-columns: 13rem repeat(31, 4.8rem);
  }
}

/* ============================================
   DRAG & DROP STYLES
   ============================================ */

/* Drag Handle */
.drag-handle {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  color: var(--gray-400);
  cursor: grab;
  padding: 0.5rem;
  user-select: none;
  line-height: 1;
  transition: color 0.2s ease;
  z-index: 1;
}

.drag-handle:hover {
  color: var(--gray-600);
}

.drag-handle:active {
  cursor: grabbing;
  color: var(--gray-700);
}

.calendar-row-header[draggable="true"] .row-header-name,
.calendar-row-header[draggable="true"] .row-header-info {
  padding-left: 3rem;
}
