:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #1d2537;
  --surface: #ffffff;
  --surface-muted: #f1f3f9;
  --border: #2f3a52;
  --text: #1f2937;
  --muted: #4b5567;
  --primary: #1d2537;
  --primary-dark: #13192b;
  --app-shell-max-width: 2400px;
  --team-column-width: 104px;
  --team-column-min-width: 84px;
  --member-column-width: 200px;
  --member-column-min-width: 148px;
  --replacement-column-width: 84px;
  --replacement-column-min-width: 72px;
  --grid-border-color: rgba(148, 163, 184, 0.22);
  --grid-header-background: linear-gradient(
    180deg,
    rgba(226, 232, 240, 0.9) 0%,
    rgba(226, 232, 240, 0.55) 100%
  );
  --weekend-header-background: linear-gradient(
    180deg,
    rgba(203, 213, 225, 0.92) 0%,
    rgba(148, 163, 184, 0.82) 100%
  );
  --holiday-header-background: linear-gradient(
    180deg,
    rgba(224, 242, 254, 0.92) 0%,
    rgba(186, 230, 253, 0.72) 100%
  );
  --grid-cell-background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(248, 250, 252, 0.96) 52%,
    rgba(241, 245, 249, 0.92) 100%
  );
  --weekend-cell-background: linear-gradient(
    180deg,
    rgba(226, 232, 240, 0.98) 0%,
    rgba(203, 213, 225, 0.94) 100%
  );
  --holiday-cell-background: linear-gradient(
    180deg,
    rgba(224, 242, 254, 0.9) 0%,
    rgba(186, 230, 253, 0.6) 100%
  );
  --grid-cell-glare: radial-gradient(
    circle at 50% -28%,
    rgba(255, 255, 255, 0.68) 0%,
    rgba(255, 255, 255, 0) 72%
  );
  --grid-cell-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(15, 23, 42, 0.05);
  --grid-cell-divider: rgba(15, 23, 42, 0.06);
  --status-chip-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  --shift-m-outline: rgba(255, 255, 0, 0.82);
  --shift-m-ring: rgba(255, 255, 0, 0.2);
  --shift-m-halo: rgba(255, 255, 0, 0.18);
  --shift-m-glow: rgba(204, 204, 0, 0.32);
  --shift-am-outline: rgba(0, 176, 240, 0.82);
  --shift-am-ring: rgba(0, 176, 240, 0.2);
  --shift-am-halo: rgba(0, 176, 240, 0.18);
  --shift-am-glow: rgba(0, 140, 191, 0.3);
  --shift-n-outline: rgba(255, 0, 0, 0.82);
  --shift-n-ring: rgba(255, 0, 0, 0.2);
  --shift-n-halo: rgba(255, 0, 0, 0.18);
  --shift-n-glow: rgba(191, 0, 0, 0.32);
  --shift-j-outline: rgba(0, 227, 0, 0.82);
  --shift-j-ring: rgba(0, 227, 0, 0.2);
  --shift-j-halo: rgba(0, 227, 0, 0.18);
  --shift-j-glow: rgba(0, 156, 0, 0.3);
  --shift-r-outline: rgba(148, 163, 184, 0.6);
  --shift-r-ring: rgba(226, 232, 240, 0.1);
  --shift-r-halo: rgba(226, 232, 240, 0.1);
  --shift-r-glow: rgba(100, 116, 139, 0.24);
  --shift-h-outline: rgba(168, 85, 247, 0.6);
  --shift-h-ring: rgba(216, 180, 254, 0.12);
  --shift-h-halo: rgba(216, 180, 254, 0.12);
  --shift-h-glow: rgba(147, 51, 234, 0.24);
  --shift-st-outline: rgba(0, 227, 0, 0.82);
  --shift-st-ring: rgba(0, 227, 0, 0.2);
  --shift-st-halo: rgba(0, 227, 0, 0.18);
  --shift-st-glow: rgba(0, 156, 0, 0.3);
  --matin-bg: rgba(255, 255, 0, 0.24);
  --matin-text: #4d4d00;
  --apresmidi-bg: rgba(0, 176, 240, 0.24);
  --apresmidi-text: #004b66;
  --nuit-bg: rgba(255, 0, 0, 0.2);
  --nuit-text: #7a0000;
  --journee-bg: rgba(0, 227, 0, 0.22);
  --journee-text: #006a00;
  --repos-bg: rgba(148, 163, 184, 0.16);
  --repos-text: #475569;
  --day-column-width: 62px;
  --day-column-min-width: 24px;
}

@media (max-width: 1280px) {
  :root {
    --team-column-width: 76px;
    --team-column-min-width: 64px;
    --member-column-width: 160px;
    --member-column-min-width: 128px;
    --day-column-width: 52px;
    --day-column-min-width: 20px;
  }

  .grid-team {
    font-size: 9px;
  }

  .team-label-text {
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .team-manage-icon {
    font-size: 16px;
  }

  .grid-member,
  .member-button {
    font-size: 10px;
  }

  .day-name {
    font-size: 11px;
  }

  .day-number {
    font-size: 14px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#root {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(29, 37, 55, 0.7), transparent 55%),
    var(--bg);
}

.app-shell {
  width: min(var(--app-shell-max-width), 100%);
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(9, 12, 19, 0.3);
  overflow: visible;
  display: flex;
  flex-direction: column;
}


.app-header {
  position: relative;
  padding: 36px 40px 26px;
  border-bottom: 1px solid rgba(122, 138, 176, 0.2);
  background:
    radial-gradient(circle at 12% -35%, rgba(96, 165, 250, 0.42), transparent 58%),
    radial-gradient(circle at 88% -20%, rgba(56, 189, 248, 0.28), transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #172554 52%, #1d4ed8 100%);
  color: #f8fbff;
}

.app-shell.is-home .app-header {
  border-bottom: none;
  padding-bottom: 30px;
}

.app-shell.is-home {
  min-height: calc(100vh - 48px);
}

.app-shell.is-home .header-layout {
  justify-content: center;
  text-align: center;
}

.home-calendar-action {
  position: absolute;
  top: 32px;
  right: 40px;
}

.maintenance-home-badge {
  position: absolute;
  top: 24px;
  left: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(254, 202, 202, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fee2e2;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}

.maintenance-home-badge:disabled {
  opacity: 0.78;
  cursor: default;
}

.app-shell.is-home .header-content {
  flex: 0 1 920px;
  min-width: 0;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.4);
  background: rgba(15, 23, 42, 0.35);
  color: #dbeafe;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 700;
}

.home-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.hero-stat {
  border: 1px solid rgba(191, 219, 254, 0.3);
  background: rgba(15, 23, 42, 0.38);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-stat-value {
  font-size: 21px;
  line-height: 1.1;
  font-weight: 700;
  color: #f8fbff;
}

.hero-stat-label {
  color: rgba(219, 234, 254, 0.9);
  font-size: 12px;
  font-weight: 500;
}


.hero-stat-inline-detail {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(219, 234, 254, 0.9);
}

.header-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.header-content {
  flex: 1 1 320px;
  min-width: 260px;
}

.header-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  flex: 0 0 auto;
}

.header-back {
  appearance: none;
  border: 1px solid rgba(80, 97, 136, 0.4);
  background: rgba(15, 21, 35, 0.25);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header-calendar-button {
  appearance: none;
  border: 1px solid rgba(147, 197, 253, 0.65);
  background: rgba(15, 23, 42, 0.42);
  color: #dbeafe;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header-calendar-button:hover,
.header-calendar-button:focus-visible {
  border-color: rgba(191, 219, 254, 0.95);
  background: rgba(30, 41, 59, 0.7);
  outline: none;
}

.header-back:hover {
  border-color: rgba(126, 150, 214, 0.65);
  background: rgba(26, 34, 52, 0.5);
}


@media (max-width: 960px) {
  .header-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 16px;
  }

  .header-back {
    order: 0;
  }

  .home-hero-stats {
    grid-template-columns: 1fr;
  }

  .home-insights {
    grid-template-columns: 1fr;
  }

  .home-modop-corner {
    position: static;
    margin-top: 8px;
    align-self: flex-end;
  }

  .maintenance-home-badge {
    top: 16px;
    left: 16px;
  }

  .home-calendar-action {
    position: static;
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
}

.app-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fbff;
}

.app-shell.is-home .app-header h1 {
  font-size: clamp(34px, 4.2vw, 52px);
}

.header-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  color: rgba(224, 231, 255, 0.95);
  max-width: 78ch;
}

.tab-controls {
  margin-top: 24px;
  display: inline-flex;
  gap: 12px;
  padding: 6px;
  background: rgba(29, 37, 55, 0.12);
  border-radius: 14px;
}

.toolbar-tab-controls {
  margin-top: 0;
  align-self: center;
  margin-left: auto;
}

.tab-button {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tab-button:hover {
  transform: translateY(-1px);
  background: rgba(29, 37, 55, 0.1);
}

.tab-button.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(29, 37, 55, 0.28);
}

.home-panel {
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  background: linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
  position: relative;
}

.home-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.home-insight-card {
  border: 1px solid rgba(125, 146, 186, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
}

.home-insight-card h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.home-insight-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.home-insight-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #1e293b;
}

.home-insight-card li span {
  font-weight: 700;
  color: #1d4ed8;
}

.home-empty {
  color: #64748b;
  justify-content: flex-start;
}

.home-modop-corner {
  position: absolute;
  right: 18px;
  bottom: 14px;
}

.home-modop-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(219, 234, 254, 0.75);
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.home-modop-link:hover {
  background: rgba(191, 219, 254, 0.95);
}

.tranche-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-signature {
  margin-top: auto;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}

.app-shell.is-home .tranche-grid {
  gap: 18px;
}

@media (min-width: 1200px) {
  .tranche-grid {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }

  .tranche-card--span-2 {
    grid-column: span 2;
    justify-self: center;
    width: calc((100% - 26px) / 2);
  }
}

.tranche-card {
  border-radius: 18px;
  border: 1px solid rgba(80, 97, 136, 0.2);
  padding: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

.app-shell.is-home .tranche-card {
  padding: 20px;
  gap: 16px;
}

.tranche-card--tranche-1, .home-shutdown-links .planning-card.tranche-card--tranche-1 {
  background: linear-gradient(160deg, #fef3c7 0%, #fde68a 100%);
}

.tranche-card--tranche-2, .home-shutdown-links .planning-card.tranche-card--tranche-2 {
  background: linear-gradient(160deg, #dbeafe 0%, #bfdbfe 100%);
}

.tranche-card--tranche-3, .home-shutdown-links .planning-card.tranche-card--tranche-3 {
  background: linear-gradient(160deg, #dcfce7 0%, #bbf7d0 100%);
}

.tranche-card--tranche-4, .home-shutdown-links .planning-card.tranche-card--tranche-4 {
  background: linear-gradient(160deg, #ffedd5 0%, #fed7aa 100%);
}

.tranche-card--tranche-1-2 {
  background: linear-gradient(160deg, #e2e8f0 0%, #cbd5e1 100%);
}

.tranche-card--tranche-3-4 {
  background: linear-gradient(160deg, #e2e8f0 0%, #cbd5e1 100%);
}

.tranche-header h2 {
  margin: 0;
  font-size: 19px;
}

.tranche-header p {
  margin: 6px 0 0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.tranche-planning-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.app-shell.is-home .tranche-planning-list {
  gap: 12px;
}

.planning-card {
  border: 1px solid rgba(80, 97, 136, 0.24);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #0f172a;
  text-align: center;
  width: 100%;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease,
    box-shadow 0.2s ease;
}

.planning-card:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(30, 64, 175, 0.16);
  transform: translateY(-1px);
}

.planning-title {
  font-weight: 700;
  font-size: 15px;
}

.planning-meta {
  font-size: 12px;
  color: var(--muted);
}

.planning-note {
  font-size: 12px;
  color: #1d4ed8;
  font-weight: 600;
}
.settings-panel {
  position: fixed;
  right: max(
    36px,
    calc((100vw - var(--app-shell-max-width)) / 2 + 36px)
  );
  bottom: 36px;
  width: 320px;
  max-width: calc(100% - 72px);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 60;
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(18px);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f1f5f9;
}

.settings-collapse {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.2s ease;
}

.settings-collapse:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(226, 232, 240, 0.5);
  color: #f8fafc;
  transform: translateY(-1px);
}

.settings-collapse:focus-visible {
  outline: 2px solid rgba(148, 163, 184, 0.8);
  outline-offset: 2px;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.76);
}


.settings-label-with-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.settings-label-with-checkbox input[type='checkbox'] {
  width: 20px;
  height: 20px;
  accent-color: #22d3ee;
}

.settings-control select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background-color: rgba(15, 23, 42, 0.35);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  appearance: none;
}

.settings-control select:focus {
  outline: 2px solid rgba(148, 163, 184, 0.7);
  outline-offset: 2px;
}


.settings-dropdown-trigger {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.35);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-dropdown-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  transition: transform 0.2s ease;
}

.settings-dropdown-trigger.is-open .settings-dropdown-chevron {
  transform: rotate(180deg);
}

.settings-dropdown-trigger:focus-visible {
  outline: 2px solid rgba(148, 163, 184, 0.7);
  outline-offset: 2px;
}


.settings-dropdown-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


.settings-control select[multiple] {
  min-height: 120px;
  max-height: 150px;
  padding: 8px;
}

.settings-control select[multiple] option {
  padding: 6px 8px;
  border-radius: 8px;
}

.settings-month-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-month-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.35);
  color: rgba(241, 245, 249, 0.9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.settings-month-option:hover,
.settings-month-option:focus-within {
  border-color: rgba(148, 163, 184, 0.55);
  transform: translateY(-1px);
}

.settings-month-option.is-active {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #e0f2fe;
}

.settings-month-option input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
}

.settings-month-option input[type='checkbox']:disabled {
  accent-color: rgba(148, 163, 184, 0.6);
  cursor: not-allowed;
}

.settings-month-option input[type='checkbox']:disabled + span {
  opacity: 0.7;
}

.settings-toggle {
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.settings-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
}

.settings-toggle-label input[type='checkbox'] {
  width: 20px;
  height: 20px;
  accent-color: #22d3ee;
}

.settings-hint {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.75);
}

.access-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.access-field-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}


.access-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.35);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
}

.access-form input:focus {
  outline: 2px solid rgba(148, 163, 184, 0.7);
  outline-offset: 2px;
}

.access-error {
  margin: 0;
  font-size: 12px;
  color: #fca5a5;
}

.access-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.access-modal.modal-panel {
  width: min(360px, 100%);
  border-radius: 16px;
}

.access-modal .modal-header {
  padding: 16px 20px 12px;
}

.access-modal .modal-title {
  font-size: 18px;
}

.access-modal .modal-body {
  padding: 12px 20px 16px;
}

.access-modal .modal-footer {
  padding: 12px 20px 18px;
}

.access-modal .access-field-label {
  color: #000;
}

.access-modal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.access-modal-footer {
  gap: 12px;
}

.maintenance-hint {
  margin: 0;
  font-size: 13px;
  color: #374151;
}

.settings-panel.is-collapsed {
  padding: 14px 18px;
  width: auto;
  min-width: 0;
  max-width: calc(100% - 72px);
  gap: 10px;
}

.settings-panel.is-collapsed .settings-title {
  font-size: 16px;
}

.settings-panel.is-collapsed .settings-content {
  display: none;
}

.settings-panel.is-collapsed .settings-collapse {
  padding-inline: 16px;
}

@media (max-width: 1024px) {
  .settings-panel {
    right: 20px;
    bottom: 20px;
    width: 280px;
    max-width: calc(100% - 40px);
  }
}

@media (max-width: 720px) {
  .settings-panel {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-width: none;
  }

  .settings-month-list {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.month-controls {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 8px 12px;
  background: rgba(29, 37, 55, 0.12);
  border-radius: 16px;
}

.month-controls button {
  appearance: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.month-controls button:disabled {
  background: rgba(29, 37, 55, 0.3);
  cursor: not-allowed;
  transform: none;
}

.month-controls button:not(:disabled):hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.month-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  min-width: 190px;
  text-align: center;
}

.calendar {
  padding: 0 36px 48px;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.planning-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.planning-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.planning-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.planning-toolbar .month-controls {
  margin: 0;
}

.planning-tab-export-group {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.planning-tab-export-group .toolbar-tab-controls {
  margin-left: 0;
}

.planning-export-button {
  appearance: none;
  border: 1px solid rgba(80, 97, 136, 0.32);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(29, 37, 55, 0.1);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.planning-export-button:hover {
  background: rgba(29, 37, 55, 0.16);
  transform: translateY(-1px);
}


.planning-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.45);
  background: rgba(15, 23, 42, 0.45);
  color: #eff6ff;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.planning-tranche-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tranche-color, rgba(129, 140, 248, 0.8));
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.planning-meta-text {
  font-weight: 600;
  color: #eff6ff;
}

.optimization-scenario {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.scenario-shift-picker {
  flex: 1 1 260px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.scenario-header-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.scenario-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  flex: 1;
  justify-content: center;
}

.scenario-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.scenario-header h3 {
  margin: 0;
  font-size: 20px;
}

.scenario-description {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.scenario-description-compact {
  margin-top: 2px;
}

.scenario-summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.scenario-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.scenario-save-alert {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  animation: save-alert-pulse 1.2s ease-in-out infinite;
}

.scenario-summary-button {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.scenario-summary-button:not(:disabled):hover {
  background: rgba(29, 37, 55, 0.12);
  transform: translateY(-1px);
}

.scenario-summary-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.scenario-summary-button.has-unsaved-changes {
  color: #dc2626;
  animation: save-alert-pulse 1.2s ease-in-out infinite;
}

.save-confirmation-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1500;
  background: #166534;
  color: #ffffff;
  padding: 18px 28px;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
  min-width: 280px;
  text-align: center;
}

.save-confirmation-popup.is-danger {
  background: #b91c1c;
  box-shadow: 0 14px 30px rgba(185, 28, 28, 0.35);
}

@keyframes save-alert-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.06);
  }
}

.scenario-button-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
}

.scenario-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scenario-nav {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(29, 37, 55, 0.08);
  border-radius: 14px;
}

@media (max-width: 960px) {

  .scenario-controls-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .scenario-button-row {
    flex-wrap: wrap;
  }
}

.scenario-nav button {
  appearance: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.scenario-nav button:disabled {
  background: rgba(29, 37, 55, 0.3);
  cursor: not-allowed;
  transform: none;
}

.scenario-nav button:not(:disabled):hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.scenario-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  min-width: 0;
  text-align: left;
}

.scenario-rest-toggle {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  background: rgba(29, 37, 55, 0.12);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.scenario-rest-toggle .scenario-rest-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(29, 37, 55, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.scenario-rest-toggle:not(:disabled):hover {
  background: rgba(29, 37, 55, 0.2);
  transform: translateY(-1px);
}

.scenario-rest-toggle.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(29, 37, 55, 0.22);
}

.scenario-rest-toggle.is-active .scenario-rest-status {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.publication-switch {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  background: #b91c1c;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(185, 28, 28, 0.28);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.publication-switch-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.publication-switch-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.publication-switch:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(185, 28, 28, 0.32);
}

.publication-switch:disabled {
  background: rgba(29, 37, 55, 0.3);
  cursor: not-allowed;
  box-shadow: none;
}

.publication-switch.is-active {
  background: #15803d;
  box-shadow: 0 10px 18px rgba(21, 128, 61, 0.32);
}

.publication-switch.is-active:not(:disabled):hover {
  box-shadow: 0 12px 22px rgba(21, 128, 61, 0.36);
}

.publication-switch-label {
  min-width: 30px;
  text-align: center;
}

.publication-switch-track {
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  position: relative;
}

.publication-switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.publication-switch.is-active .publication-switch-thumb {
  transform: translateX(22px);
}

.scenario-validate {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  background: #0b6e4f;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(11, 110, 79, 0.28);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.scenario-validate:disabled {
  background: rgba(11, 110, 79, 0.35);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.scenario-validate:not(:disabled):hover {
  background: #09563f;
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(9, 86, 63, 0.32);
}

.scenario-validate.has-errors {
  background: #b91c1c;
  box-shadow: 0 12px 24px rgba(185, 28, 28, 0.32);
}

.scenario-validate.has-errors:not(:disabled):hover {
  background: #991b1b;
  box-shadow: 0 14px 28px rgba(153, 27, 27, 0.34);
}

.scenario-validate.is-clear {
  background: #15803d;
  box-shadow: 0 12px 24px rgba(21, 128, 61, 0.28);
}

.scenario-validate.is-clear:not(:disabled):hover {
  background: #166534;
  box-shadow: 0 14px 28px rgba(22, 101, 52, 0.32);
}

.optimization-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

.optimization-table-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.optimization-month-group {
  border-radius: 12px;
  border: 1px solid rgba(47, 58, 82, 0.18);
  background: #fff;
  overflow: hidden;
}

.optimization-month-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  background: rgba(29, 37, 55, 0.08);
  list-style: none;
}

.optimization-month-group[open] .optimization-month-summary {
  border-bottom: 1px solid rgba(47, 58, 82, 0.18);
}

.optimization-month-label {
  font-size: 15px;
  color: var(--text);
}

.optimization-month-count {
  font-size: 13px;
  color: var(--muted);
}

.optimization-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.optimization-col-date {
  width: 110px;
}

.optimization-col-shift {
  width: 100px;
}

.optimization-col-absent,
.optimization-col-replacement {
  width: 25%;
}

.optimization-col-justification {
  width: 18%;
}

.optimization-table th,
.optimization-table td {
  border: 1px solid rgba(47, 58, 82, 0.18);
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

.optimization-cell-absent {
  white-space: normal;
}

.optimization-cell-justification .opt-justification-row {
  gap: 8px;
}

.optimization-table thead {
  background: rgba(29, 37, 55, 0.08);
}

.optimization-table tbody tr:nth-child(even) {
  background: rgba(29, 37, 55, 0.04);
}

.optimization-table tbody tr.is-valid {
  background: rgba(34, 197, 94, 0.14);
}

.optimization-table tbody tr.is-valid td {
  border-color: rgba(22, 163, 74, 0.45);
  border-top-width: 2px;
  border-bottom-width: 2px;
}

.optimization-table tbody tr.is-valid td:first-child {
  border-left-width: 2px;
}

.optimization-table tbody tr.is-valid td:last-child {
  border-right-width: 2px;
}

.optimization-table tbody tr.is-invalid {
  background: rgba(248, 113, 113, 0.18);
}

.optimization-table tbody tr.is-invalid td {
  border-color: rgba(220, 38, 38, 0.4);
}

.optimization-table tbody tr.is-shift-override {
  background: rgba(13, 148, 136, 0.1);
}

.optimization-table tbody tr.is-shift-override td {
  border-color: rgba(13, 148, 136, 0.28);
}

.optimization-table tbody tr.is-shift-override:nth-child(even) {
  background: rgba(13, 148, 136, 0.14);
}

.replacement-cell.is-shift-override .replacement-label {
  font-weight: 700;
  color: #0f766e;
}

.optimization-table td.is-awaiting-choice {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(37, 99, 235, 0.3);
}

.replacement-cell.is-awaiting-choice .replacement-label {
  color: #1d4ed8;
  font-weight: 700;
}

.leave-requirement-summary {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(47, 58, 82, 0.18);
  background: rgba(29, 37, 55, 0.05);
}

.leave-requirement-summary[open] .leave-requirement-summary-title {
  border-bottom: 1px solid rgba(47, 58, 82, 0.18);
}

.leave-requirement-summary-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.leave-requirement-summary-content {
  padding-top: 12px;
}

.leave-requirement-summary-count {
  font-size: 13px;
  color: var(--muted);
}

.leave-requirement-intro {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.leave-requirement-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leave-requirement-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(47, 58, 82, 0.18);
  background: #fff;
}

.leave-requirement-item.is-complete {
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.leave-requirement-item.is-pending {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(251, 191, 36, 0.1);
}

.leave-requirement-name {
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.leave-requirement-team {
  font-size: 12px;
  color: var(--muted);
}

.leave-requirement-status {
  font-size: 13px;
  font-weight: 600;
}

.leave-requirement-count {
  font-size: 13px;
}

.leave-requirement-warning {
  margin: 12px 0 0;
  font-weight: 600;
  color: #b45309;
}

.leave-requirement-success {
  margin: 12px 0 0;
  font-weight: 600;
  color: #15803d;
}

.replacement-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.replacement-select-label {
  width: 100%;
}

.replacement-select {
  appearance: none;
  border: 1px solid rgba(29, 37, 55, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  font-size: 14px;
  min-width: 210px;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.shift-override-reset {
  appearance: none;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  margin-top: 6px;
  cursor: pointer;
  text-decoration: underline;
}

.shift-override-reset:hover {
  color: var(--primary-dark);
}

.replacement-select option.replacement-option-warning {
  color: var(--muted);
}

.replacement-select:focus {
  outline: 2px solid rgba(29, 37, 55, 0.32);
  outline-offset: 1px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.optimization-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.opt-justification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.opt-justification-row .opt-justification-text {
  flex: 1;
}

.optimization-unresolved {
  border-top: 1px dashed rgba(47, 58, 82, 0.26);
  padding-top: 12px;
}

.optimization-unresolved h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.optimization-unresolved ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.validation-feedback {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.validation-feedback.has-errors {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(220, 38, 38, 0.45);
  color: #991b1b;
}

.validation-feedback.is-success {
  color: #14532d;
}

.validation-feedback h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.validation-feedback ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.5;
}

.validation-issues-list {
  list-style: none;
  padding-left: 0;
}

.validation-issue-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #b91c1c;
}

.validation-issue-box {
  line-height: 1;
  transform: translateY(1px);
}

.optimization-grid-wrapper {
  border: 1px solid rgba(47, 58, 82, 0.16);
  border-radius: 18px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.optimization-grid {
  min-width: 900px;
  padding: 12px;
  gap: 0;
  position: relative;
  z-index: 0;
}

.optimization-grid-day {
  position: relative;
  overflow: visible;
  z-index: 1;
}

.grid-header-day.is-impacted {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
  box-shadow: inset 0 -2px 0 rgba(59, 130, 246, 0.5);
}

.grid-header-day.has-validation-error {
  background: rgba(248, 113, 113, 0.24);
  color: #b91c1c;
  box-shadow: inset 0 -2px 0 rgba(248, 113, 113, 0.6);
}

.grid-header-day.has-validation-error-column {
  background: rgba(239, 68, 68, 0.42);
  color: #991b1b;
  box-shadow:
    inset 0 0 0 1px rgba(220, 38, 38, 0.85),
    inset 0 -2px 0 rgba(220, 38, 38, 0.6);
}

.cell-replacement {
  background: var(--grid-cell-background);
  border: 1px solid var(--grid-border-color);
  box-shadow: var(--grid-cell-shadow);
  position: relative;
  overflow: visible;
}

.calendar-grid .grid-day.cell-has-shift {
  border-color: var(--grid-border-color);
}

.calendar-grid .grid-day.cell-has-shift::before {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 0 0 2px rgba(148, 163, 184, 0.08);
}

.cell-shift-editable {
  cursor: pointer;
}

.cell-shift-editing {
  z-index: 5;
}

.cell-shift-editable:focus,
.cell-shift-editable:focus-within {
  outline: 2px solid rgba(29, 37, 55, 0.4);
  outline-offset: -2px;
}

.optimization-shift-picker {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  width: min(420px, 100%);
  max-width: 100%;
  overflow: visible;
  z-index: 9999;
}

.cell-shift-editing > .status-chip {
  opacity: 0;
  visibility: hidden;
}

.optimization-shift-picker .status-chip {
  opacity: 1;
  visibility: visible;
}

.opt-validation-shift-overrides {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.optimization-shift-option {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.optimization-shift-option .status-chip {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  font-size: 14px;
}

.optimization-shift-option:hover,
.optimization-shift-option:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.16);
  outline: none;
}

.optimization-shift-option.is-active {
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(29, 78, 216, 0.2);
}

.shift-option-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cell-locked {
  box-shadow: inset 0 0 0 2px rgba(29, 37, 55, 0.45);
}

.optimization-grid .cell-lockable {
  cursor: pointer;
}

.optimization-grid .cell-lockable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.cell-replacement::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  opacity: 0;
  transition: background-color 0.2s ease;
  pointer-events: none;
  z-index: 0;
}

.cell-replacement > * {
  position: relative;
  z-index: 1;
}

.cell-replacement .status-chip {
  box-shadow: var(--status-chip-inner-shadow);
}

.cell-replacement-valid {
  border-color: rgba(22, 163, 74, 0.9);
  --grid-cell-background: rgba(34, 197, 94, 0.7);
  --grid-cell-glare: none;
  background-image: none;
  background-color: rgba(34, 197, 94, 0.9);
}

.cell-replacement-valid::after {
  background: rgba(34, 197, 94, 0.75);
  opacity: 0;
}

.cell-replacement-valid .status-chip {
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.55);
}

.cell-replacement-error {
  border-color: rgba(220, 38, 38, 0.9);
  --grid-cell-background: rgba(248, 113, 113, 0.7);
  --grid-cell-glare: none;
  background-image: none;
  background-color: rgba(248, 113, 113, 0.9);
}

.optimization-grid .grid-cell.cell-replacement-valid {
  background: rgba(34, 197, 94, 0.9) !important;
  background-color: rgba(34, 197, 94, 0.9) !important;
  background-image: none !important;
}

.optimization-grid .grid-cell.cell-replacement-error {
  background: rgba(248, 113, 113, 0.9) !important;
  background-color: rgba(248, 113, 113, 0.9) !important;
  background-image: none !important;
}

.cell-replacement-error::after {
  background: rgba(248, 113, 113, 0.75);
  opacity: 0;
}

.cell-replacement-error .status-chip {
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.6);
}

.optimization-grid .grid-cell.cell-rh-error {
  border-color: rgba(220, 38, 38, 0.9);
  --grid-cell-background: rgba(248, 113, 113, 0.9);
  --grid-cell-glare: none;
  background: rgba(248, 113, 113, 0.9) !important;
  background-color: rgba(248, 113, 113, 0.9) !important;
  background-image: none !important;
}

.optimization-grid .grid-cell.cell-rh-error .status-chip {
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.6);
}

.opt-date {
  font-weight: 600;
  display: inline-block;
  margin-right: 6px;
  color: var(--primary);
}

.opt-day {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.opt-shift-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.opt-justification-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.opt-validation-messages {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}

.opt-validation-messages li {
  margin-bottom: 4px;
}

.opt-validation-success {
  margin: 8px 0 0;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
}

.grid-wrapper {
  margin-top: 0;
  border: 1px solid var(--grid-border-color);
  border-radius: 20px;
  overflow: visible;
  background: linear-gradient(145deg, #eef2ff 0%, #f8fafc 45%, #ffffff 100%);
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  display: block;
  width: 100%;
  padding: 8px 12px 12px;
}

.calendar-grid {
  display: grid;
  width: 100%;
  grid-auto-rows: 56px;
  background: var(--grid-cell-background);
  border-radius: 16px;
  box-shadow:
    var(--grid-cell-shadow),
    0 4px 12px rgba(15, 23, 42, 0.05);
}

.grid-header,
.grid-cell {
  border: 1px solid var(--grid-border-color);
  padding: 8px 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.grid-header {
  background: var(--grid-header-background);
  font-weight: 600;
  color: rgba(15, 23, 42, 0.85);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.75);
}

.grid-header-sticky {
  position: sticky;
  top: 0;
  z-index: 14;
  background-image: none;
  background-color: #e6edf9;
}

.grid-header-day.grid-header-sticky.is-weekend {
  background: #d8e3f8;
}

.grid-header-day.grid-header-sticky.is-holiday {
  background: #f5e0c2;
}

.grid-header-day.grid-header-sticky.has-validation-error-column,
.grid-header-day.grid-header-sticky.has-validation-error-column.is-weekend,
.grid-header-day.grid-header-sticky.has-validation-error-column.is-holiday {
  background: #f8b4b4;
}

.grid-header-day {
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.88);
  letter-spacing: normal;
  text-transform: none;
}

.grid-header-day.is-weekend {
  background: var(--weekend-header-background);
}

.grid-header-day.is-holiday {
  background: var(--holiday-header-background);
}

.grid-header-day.has-validation-error-column.is-weekend,
.grid-header-day.has-validation-error-column.is-holiday {
  background: rgba(239, 68, 68, 0.42);
  color: #991b1b;
  box-shadow:
    inset 0 0 0 1px rgba(220, 38, 38, 0.85),
    inset 0 -2px 0 rgba(220, 38, 38, 0.6);
}

.grid-header-team,
.grid-header-member,
.grid-header-replacements-details {
  color: var(--muted);
}

.grid-cell {
  --cell-shift-border-color: var(--grid-border-color);
  --cell-shift-ring-color: rgba(148, 163, 184, 0.08);
  --cell-shift-halo-color: rgba(15, 23, 42, 0);
  --cell-shift-glow-color: rgba(15, 23, 42, 0);
  --cell-shift-highlight-color: rgba(255, 255, 255, 0.16);
  background: var(--grid-cell-glare), var(--grid-cell-background);
  box-shadow:
    var(--grid-cell-shadow),
    0 1px 0 var(--grid-cell-divider),
    0 2px 6px rgba(15, 23, 42, 0.05);
}

.grid-cell.cell-reference-leave {
  box-shadow:
    inset 0 3px 0 rgba(6, 182, 212, 0.95),
    inset 0 6px 12px rgba(6, 182, 212, 0.15),
    var(--grid-cell-shadow),
    0 1px 0 var(--grid-cell-divider),
    0 2px 6px rgba(15, 23, 42, 0.05);
}

.grid-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px var(--cell-shift-highlight-color),
    inset 0 0 0 2px var(--cell-shift-ring-color);
  pointer-events: none;
  z-index: 1;
}

.grid-cell.cell-reference-leave::before {
  background: linear-gradient(
    180deg,
    rgba(6, 182, 212, 1) 0,
    rgba(6, 182, 212, 1) 6px,
    rgba(6, 182, 212, 0.35) 6px,
    transparent 8px
  );
}

.grid-cell.cell-has-shift {
  border-color: var(--cell-shift-border-color);
  --cell-shift-highlight-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    var(--grid-cell-shadow),
    0 1px 0 var(--grid-cell-divider),
    0 2px 6px rgba(15, 23, 42, 0.05),
    0 12px 20px var(--cell-shift-glow-color);
}

.grid-cell.cell-has-shift::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 9px;
  background: var(--cell-shift-halo-color);
  opacity: 0.48;
  pointer-events: none;
  z-index: 0;
}

.grid-cell > * {
  position: relative;
  z-index: 2;
}

.grid-cell.cell-shift-m {
  --cell-shift-border-color: var(--grid-border-color);
  --cell-shift-ring-color: rgba(148, 163, 184, 0.08);
  --cell-shift-halo-color: rgba(15, 23, 42, 0);
  --cell-shift-glow-color: rgba(15, 23, 42, 0);
}

.grid-cell.cell-shift-am {
  --cell-shift-border-color: var(--grid-border-color);
  --cell-shift-ring-color: rgba(148, 163, 184, 0.08);
  --cell-shift-halo-color: rgba(15, 23, 42, 0);
  --cell-shift-glow-color: rgba(15, 23, 42, 0);
}

.grid-cell.cell-shift-n {
  --cell-shift-border-color: var(--grid-border-color);
  --cell-shift-ring-color: rgba(148, 163, 184, 0.08);
  --cell-shift-halo-color: rgba(15, 23, 42, 0);
  --cell-shift-glow-color: rgba(15, 23, 42, 0);
}

.grid-cell.cell-shift-j {
  --cell-shift-border-color: var(--grid-border-color);
  --cell-shift-ring-color: rgba(148, 163, 184, 0.08);
  --cell-shift-halo-color: rgba(15, 23, 42, 0);
  --cell-shift-glow-color: rgba(15, 23, 42, 0);
}

.grid-cell.cell-shift-r {
  --cell-shift-border-color: var(--shift-r-outline);
  --cell-shift-ring-color: var(--shift-r-ring);
  --cell-shift-halo-color: var(--shift-r-halo);
  --cell-shift-glow-color: var(--shift-r-glow);
}

.grid-cell.cell-shift-h {
  --cell-shift-border-color: var(--shift-h-outline);
  --cell-shift-ring-color: var(--shift-h-ring);
  --cell-shift-halo-color: var(--shift-h-halo);
  --cell-shift-glow-color: var(--shift-h-glow);
}

.grid-cell.cell-shift-st {
  --cell-shift-border-color: var(--grid-border-color);
  --cell-shift-ring-color: rgba(148, 163, 184, 0.08);
  --cell-shift-halo-color: rgba(15, 23, 42, 0);
  --cell-shift-glow-color: rgba(15, 23, 42, 0);
}

.grid-replacement-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.grid-replacement-count.is-zero {
  color: var(--muted);
  font-weight: 600;
}

.grid-replacement-details {
  display: flex;
  align-items: center;
  justify-content: center;
}

.replacement-details-button {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.replacement-details-button:hover:not(:disabled),
.replacement-details-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 6px 12px rgba(15, 23, 42, 0.12);
  border-color: rgba(59, 130, 246, 0.7);
}

.replacement-details-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.replacement-details-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.replacement-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.replacement-detail-table th,
.replacement-detail-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.replacement-detail-table th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

.replacement-detail-table thead th {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.replacement-detail-table tbody tr:last-child th,
.replacement-detail-table tbody tr:last-child td {
  border-bottom: none;
}

.replacement-detail-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.replacement-detail-metrics p {
  margin: 0;
}


.grid-team {
  background: transparent;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.88);
  font-size: 11px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.team-cell {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.team-label-text {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.team-manage-button {
  appearance: none;
  border: none;
  background: none;
  width: 100%;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  color: inherit;
  transition: color 0.2s ease, transform 0.2s ease;
}

.team-manage-button:hover,
.team-manage-button:focus-visible {
  color: var(--primary-dark);
  transform: translateY(-1px);
  outline: none;
}

.team-manage-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.team-manage-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.grid-member {
  background: transparent;
  font-weight: 500;
  color: rgba(71, 85, 105, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 12px;
}

.member-button {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.78));
  padding: 8px 10px;
  width: 100%;
  color: rgba(15, 23, 42, 0.88);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 12px;
  box-shadow:
    var(--status-chip-inner-shadow),
    0 6px 12px rgba(148, 163, 184, 0.22);
}

.grid-day {
  min-width: var(--day-track-width, var(--day-column-width));
}

.grid-day.is-weekend {
  --grid-cell-background: var(--weekend-cell-background);
}

.grid-day.is-holiday {
  --grid-cell-background: var(--holiday-cell-background);
}

.member-button:hover,
.member-button:focus-visible {
  color: var(--primary-dark);
  transform: translateY(-1px);
  outline: none;
  box-shadow:
    var(--status-chip-inner-shadow),
    0 10px 16px rgba(15, 23, 42, 0.18);
}

.member-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    var(--status-chip-inner-shadow),
    0 4px 8px rgba(148, 163, 184, 0.12);
}

.day-name {
  display: block;
  font-weight: 600;
  color: rgba(71, 85, 105, 0.95);
  font-size: 11px;
}

.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow:
    var(--status-chip-inner-shadow),
    0 4px 10px rgba(148, 163, 184, 0.25);
}

.status-chip {
  --chip-bg: rgba(248, 250, 252, 0.92);
  --chip-border: rgba(148, 163, 184, 0.55);
  --chip-shadow-color: rgba(15, 23, 42, 0.2);
  --chip-color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(
    14px,
    calc(var(--day-track-width, var(--day-column-width)) * 0.62),
    40px
  );
  min-width: 14px;
  min-height: 14px;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: transform 0.2s ease;
  position: relative;
  border: 2px solid var(--chip-border);
  aspect-ratio: 1 / 1;
  background: var(--chip-bg);
  color: var(--chip-color);
  overflow: hidden;
  box-shadow:
    var(--status-chip-inner-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 8px 16px var(--chip-shadow-color),
    0 0 0 1px rgba(255, 255, 255, 0.24);
}

.status-chip::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 32%,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0) 65%
  );
  opacity: 0.38;
  pointer-events: none;
}

.status-chip abbr {
  text-decoration: none;
  color: inherit;
}

.status-chip:hover {
  transform: translateY(-2px);
}

.status-m {
  --chip-bg: linear-gradient(
    180deg,
    rgba(255, 255, 179, 0.96) 0%,
    rgba(255, 255, 102, 0.9) 52%,
    rgba(255, 255, 0, 0.84) 100%
  );
  --chip-border: rgba(214, 214, 0, 0.72);
  --chip-shadow-color: rgba(181, 181, 0, 0.28);
  --chip-color: #4d4d00;
}

.status-am {
  --chip-bg: linear-gradient(
    180deg,
    rgba(167, 231, 255, 0.96) 0%,
    rgba(77, 208, 255, 0.9) 55%,
    rgba(0, 176, 240, 0.84) 100%
  );
  --chip-border: rgba(0, 150, 204, 0.72);
  --chip-shadow-color: rgba(0, 150, 204, 0.28);
  --chip-color: #004b66;
}

.status-n {
  --chip-bg: linear-gradient(
    180deg,
    rgba(255, 179, 179, 0.95) 0%,
    rgba(255, 92, 92, 0.9) 55%,
    rgba(255, 0, 0, 0.84) 100%
  );
  --chip-border: rgba(204, 0, 0, 0.72);
  --chip-shadow-color: rgba(204, 0, 0, 0.28);
  --chip-color: #7a0000;
}

.status-j {
  --chip-bg: linear-gradient(
    180deg,
    rgba(179, 255, 179, 0.95) 0%,
    rgba(92, 255, 92, 0.9) 55%,
    rgba(0, 227, 0, 0.84) 100%
  );
  --chip-border: rgba(0, 181, 0, 0.72);
  --chip-shadow-color: rgba(0, 156, 0, 0.28);
  --chip-color: #006a00;
}

.status-r {
  --chip-bg: linear-gradient(
    180deg,
    rgba(241, 245, 249, 0.95) 0%,
    rgba(226, 232, 240, 0.9) 55%,
    rgba(148, 163, 184, 0.84) 100%
  );
  --chip-border: rgba(148, 163, 184, 0.58);
  --chip-shadow-color: rgba(148, 163, 184, 0.24);
  --chip-color: #1f2937;
  font-weight: 600;
}

.status-h {
  --chip-bg: linear-gradient(
    180deg,
    rgba(243, 232, 255, 0.95) 0%,
    rgba(221, 214, 254, 0.88) 55%,
    rgba(196, 181, 253, 0.82) 100%
  );
  --chip-border: rgba(168, 85, 247, 0.58);
  --chip-shadow-color: rgba(147, 51, 234, 0.24);
  --chip-color: #4c1d95;
  font-weight: 600;
}

.status-st {
  --chip-bg: linear-gradient(
    180deg,
    rgba(179, 255, 179, 0.95) 0%,
    rgba(92, 255, 92, 0.9) 55%,
    rgba(0, 227, 0, 0.84) 100%
  );
  --chip-border: rgba(0, 181, 0, 0.72);
  --chip-shadow-color: rgba(0, 156, 0, 0.28);
  --chip-color: #006a00;
  font-weight: 600;
}

.status-leave {
  --chip-bg: radial-gradient(
    circle at 32% 28%,
    rgba(254, 252, 232, 0.96),
    rgba(254, 243, 199, 0.48)
  );
  --chip-border: rgba(237, 125, 49, 0.7);
  --chip-shadow-color: rgba(237, 125, 49, 0.34);
  --chip-color: #8a3f0f;
  font-weight: 700;
}

.status-farn {
  --chip-bg: radial-gradient(
    circle at 32% 28%,
    rgba(239, 246, 255, 0.96),
    rgba(191, 219, 254, 0.5)
  );
  --chip-border: rgba(37, 99, 235, 0.6);
  --chip-shadow-color: rgba(37, 99, 235, 0.32);
  --chip-color: #1e3a8a;
  font-weight: 700;
}

.status-indisponible {
  --chip-bg: radial-gradient(
    circle at 32% 28%,
    rgba(203, 213, 225, 0.96),
    rgba(100, 116, 139, 0.86)
  );
  --chip-border: rgba(51, 65, 85, 0.6);
  --chip-shadow-color: rgba(30, 41, 59, 0.3);
  --chip-color: #0f172a;
  font-weight: 700;
}

.legend .status-chip {
  border-radius: 999px;
  width: auto;
  height: auto;
  padding: 6px 12px;
}

.cell-leave {
  background-image:
    linear-gradient(135deg, rgba(255, 230, 204, 0.95), rgba(237, 125, 49, 0.45)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.55) 0px,
      rgba(255, 255, 255, 0.55) 10px,
      rgba(237, 125, 49, 0.45) 10px,
      rgba(237, 125, 49, 0.45) 20px
    );
}

.cell-farn {
  background-image:
    linear-gradient(135deg, rgba(219, 234, 254, 0.88), rgba(59, 130, 246, 0.2)),
    repeating-linear-gradient(
      -45deg,
      rgba(191, 219, 254, 0.6) 0px,
      rgba(191, 219, 254, 0.6) 10px,
      rgba(96, 165, 250, 0.35) 10px,
      rgba(96, 165, 250, 0.35) 20px
    );
}

.cell-indisponible {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.72)),
    repeating-linear-gradient(
      -45deg,
      rgba(2, 6, 23, 0.62) 0px,
      rgba(2, 6, 23, 0.62) 9px,
      rgba(2, 6, 23, 0.42) 9px,
      rgba(2, 6, 23, 0.42) 18px
    );
}

.cell-leave .status-chip.leave-shift-chip {
  --chip-border: rgba(237, 125, 49, 0.65);
  --chip-shadow-color: rgba(237, 125, 49, 0.32);
  --chip-color: #8a3f0f;
  font-weight: 700;
}

.grid-team-extra .team-cell {
  font-weight: 600;
  color: var(--muted);
}

.member-label-text {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cell-extra-shift {
  flex-direction: column;
  gap: 6px;
}

.extra-shift-modal {
  width: min(520px, 100%);
}

.extra-shift-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.extra-shift-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.extra-shift-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.extra-shift-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.extra-shift-field input:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}

.extra-shift-field input:disabled {
  background: rgba(226, 232, 240, 0.6);
  color: rgba(71, 85, 105, 0.7);
}

.extra-shift-footer {
  justify-content: space-between;
}

.extra-shift-save {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.2);
  color: var(--primary-dark);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.extra-shift-save:hover,
.extra-shift-save:focus-visible {
  background: rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
  outline: none;
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-panel {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
  width: min(720px, 100%);
  max-height: min(90vh, 780px);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--muted);
}

.modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
}

.modal-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.modal-month {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-dark);
}

.modal-close {
  appearance: none;
  border: none;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: rgba(37, 99, 235, 0.18);
  color: var(--primary-dark);
  outline: none;
}

.modal-body {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.modal-instruction {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.team-composition-modal {
  width: min(760px, 100%);
}

.team-composition-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.team-composition-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.team-composition-field select,
.team-composition-field input {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: #fff;
}

.team-composition-summary {
  margin: 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

.team-composition-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.team-composition-single-block {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 12px;
  background: rgba(248, 250, 252, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-composition-role-row h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.team-composition-role-row ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.team-composition-role-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.team-composition-role-empty {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.team-composition-team {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 12px;
  background: rgba(248, 250, 252, 0.85);
}

.team-composition-team h3 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
}

.team-composition-team h3 span {
  font-size: 12px;
  color: var(--muted);
}

.team-composition-subteam {
  margin-top: 10px;
}

.team-composition-subteam h4 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.team-composition-subteam h4 span {
  font-size: 11px;
}

.team-composition-team ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.team-composition-team li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}


.team-composition-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.leave-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.toolbar-cp-button {
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.toolbar-cp-button.is-active {
  background: rgba(249, 115, 22, 0.2);
  border-color: #f97316;
  color: #9a3412;
}

.cell-cp-selectable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.calendar-grid .cell-leave-drag {
  cursor: grabbing;
  outline: 2px solid #176c62;
  outline-offset: -2px;
}

.leave-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leave-period {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(226, 232, 240, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.45);
  transition: border 0.2s ease, background 0.2s ease;
}

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

.leave-period-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.leave-period-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.leave-period-inputs {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.leave-period-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leave-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.leave-period-field input,
.leave-period-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.leave-period-field input:focus-visible,
.leave-period-field select:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}

.leave-period-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.leave-remove {
  appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.leave-remove:hover,
.leave-remove:focus-visible {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
  transform: translateY(-1px);
  outline: none;
}

.leave-period.has-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(254, 226, 226, 0.65);
}

.leave-period.has-error .leave-period-field input {
  border-color: rgba(239, 68, 68, 0.6);
}

.leave-period.has-error .leave-period-title {
  color: #b91c1c;
}

.leave-field-error {
  margin: 4px 0 0;
  font-size: 11px;
  color: #b91c1c;
}

.leave-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.leave-add,
.leave-clear {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.leave-add {
  background: rgba(37, 99, 235, 0.18);
  color: var(--primary-dark);
}

.leave-add:hover,
.leave-add:focus-visible {
  background: rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.leave-clear {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.leave-clear:hover,
.leave-clear:focus-visible {
  background: rgba(248, 113, 113, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.leave-summary {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  white-space: normal;
}

.team-management-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.team-member-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.team-member-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(226, 232, 240, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.45);
  transition: border 0.2s ease, background 0.2s ease;
}

.team-member-item:hover {
  border-color: var(--primary);
}

.team-member-fields {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-member-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.team-member-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.team-member-input:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}

.team-member-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.team-member-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-member-tag.tag-additional {
  background: rgba(37, 99, 235, 0.14);
  color: var(--primary-dark);
}

.team-member-tag.tag-base {
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.team-member-reset,
.team-member-remove {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.team-member-reset {
  background: rgba(37, 99, 235, 0.16);
  color: var(--primary-dark);
}

.team-member-reset:hover,
.team-member-reset:focus-visible {
  background: rgba(37, 99, 235, 0.24);
  transform: translateY(-1px);
  outline: none;
}

.team-member-reset:disabled {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(71, 85, 105, 0.7);
  cursor: not-allowed;
  transform: none;
}

.team-member-remove {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.team-member-remove:hover,
.team-member-remove:focus-visible {
  background: rgba(248, 113, 113, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.team-member-actions-row {
  display: flex;
  justify-content: flex-end;
}

.team-member-add {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.2);
  color: var(--primary-dark);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.team-member-add:hover,
.team-member-add:focus-visible {
  background: rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.modal-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.modal-secondary {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.24);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.modal-secondary:hover,
.modal-secondary:focus-visible {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-dark);
  transform: translateY(-1px);
  outline: none;
}

@media (max-width: 1024px) {
  #root {
    padding: 16px;
  }

  .app-shell {
    border-radius: 18px;
  }

  .calendar {
    padding: 0 20px 28px;
  }

  .modal-panel {
    width: 100%;
    border-radius: 18px;
  }

  .modal-body {
    padding: 20px;
  }

  .team-composition-filters {
    grid-template-columns: 1fr;
  }

  .leave-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .leave-remove {
    justify-self: flex-end;
  }

  .modal-footer {
    padding: 16px 20px;
  }
}

