.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  position: relative;
  scrollbar-gutter: auto !important;
  background: transparent !important;
}

table {
  width: 100%;
  min-width: 920px;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: transparent !important;
}

th,
td {
  border: 1px solid rgba(255, 255, 255, 0.055);
  padding: 6px;
  text-align: center;
  border-radius: 0 !important;
  box-sizing: border-box;
}

th {
  font-size: 12px;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.025);
}

th:first-child {
  left: 0;
  z-index: 7;
  box-shadow: none !important;
  background-clip: border-box !important;
  transform: translateX(0.5px);
}

td.name-cell {
  text-align: left;
  min-width: 184px;
  width: 184px;
  position: sticky;
  left: 0;
  z-index: 6;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-clip: border-box !important;
  background-origin: border-box;
  box-shadow: none !important;
  border-left: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.055) !important;
  transform: translateX(0.5px);
}

.name {
  font-weight: 800;
  margin-bottom: 3px;
  font-size: 13px;
  line-height: 1.2;
  color: var(--text);
}

.subname {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.035);
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
}

/* ==================== EMPLOYEE COLOR LABELS ==================== */

td.name-cell.employee-color {
  position: sticky;
  overflow: hidden;
  color: #eef4ff;
  background-image: none !important;
  background-blend-mode: normal !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

td.name-cell.employee-color .name {
  color: #ffffff;
}

td.name-cell.employee-color .subname {
  color: rgba(255,255,255,0.82);
}

td.name-cell.employee-color .sub-chip {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.96);
}

td.name-cell.employee-color-indigo {
  background:
    linear-gradient(
      180deg,
      rgba(99,102,241,0.52),
      rgba(99,102,241,0.38)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(99,102,241,0.28),
    inset 0 0 26px rgba(99,102,241,0.16);
}

td.name-cell.employee-color-blue {
  background:
    linear-gradient(
      180deg,
      rgba(59,130,246,0.52),
      rgba(59,130,246,0.38)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(59,130,246,0.28),
    inset 0 0 26px rgba(59,130,246,0.16);
}

td.name-cell.employee-color-green {
  background:
    linear-gradient(
      180deg,
      rgba(34,197,94,0.50),
      rgba(34,197,94,0.36)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(34,197,94,0.24),
    inset 0 0 26px rgba(34,197,94,0.14);
}

td.name-cell.employee-color-yellow {
  background:
    linear-gradient(
      180deg,
      rgba(234,179,8,0.50),
      rgba(234,179,8,0.34)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(234,179,8,0.24),
    inset 0 0 24px rgba(234,179,8,0.12);
}

td.name-cell.employee-color-orange {
  background:
    linear-gradient(
      180deg,
      rgba(249,115,22,0.52),
      rgba(249,115,22,0.36)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(249,115,22,0.24),
    inset 0 0 24px rgba(249,115,22,0.14);
}

td.name-cell.employee-color-red {
  background:
    linear-gradient(
      180deg,
      rgba(239,68,68,0.54),
      rgba(239,68,68,0.38)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(239,68,68,0.26),
    inset 0 0 26px rgba(239,68,68,0.14);
}

td.name-cell.employee-color-pink {
  background:
    linear-gradient(
      180deg,
      rgba(236,72,153,0.54),
      rgba(236,72,153,0.38)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(236,72,153,0.26),
    inset 0 0 26px rgba(236,72,153,0.14);
}

td.name-cell.employee-color-purple {
  background:
    linear-gradient(
      180deg,
      rgba(168,85,247,0.52),
      rgba(168,85,247,0.38)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(168,85,247,0.24),
    inset 0 0 24px rgba(168,85,247,0.14);
}

td.name-cell.employee-color-gray {
  background:
    linear-gradient(
      180deg,
      rgba(148,163,184,0.38),
      rgba(148,163,184,0.26)
    ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(148,163,184,0.18),
    inset 0 0 20px rgba(148,163,184,0.08);
}

/* ==================== GLOBAL SEAMS ==================== */

.table-wrap table th:first-child,
.table-wrap table td:first-child {
  border-left: none !important;
}

.table-wrap table th:last-child,
.table-wrap table td:last-child {
  border-right: none !important;
}

.table-wrap table tr:first-child th {
  border-top: none !important;
}

.table-wrap table tr:last-child td {
  border-bottom: none !important;
}

tr > th:nth-child(2),
tr > td:nth-child(2) {
  border-left: none !important;
}

/* ==================== POSITION ROW ==================== */

tr.position-row th {
  position: static;
  z-index: auto;
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02);
  color: #eef4ff;
}

.position-row-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
}

.position-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-add-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(147, 197, 253, 0.36);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.external-add-btn:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(147, 197, 253, 0.58);
  color: #ffffff;
}

.external-add-btn:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 2px;
}

tr.position-row th:first-child {
  left: auto;
  transform: none !important;
}

tr.position-row + tr th {
  border-top: none !important;
}

/* ==================== POSITION / INNER BLOCK FIX ==================== */

.position-block {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  box-shadow: none !important;
}

.position-block + .position-block {
  margin-top: 0 !important;
}

.position-block .table-wrap,
.position-block .table-wrap table {
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.position-block .table-wrap {
  border: none !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}

.position-block .table-wrap table {
  background: transparent !important;
}

.position-block .table-wrap table,
.position-block .table-wrap tbody,
.position-block .table-wrap tr {
  margin: 0 !important;
  padding: 0 !important;
}

.position-block .table-wrap th:first-child,
.position-block .table-wrap td:first-child {
  border-left: none !important;
}

.position-block .table-wrap th:last-child,
.position-block .table-wrap td:last-child {
  border-right: none !important;
}

.position-block .table-wrap tr:last-child td {
  border-bottom: none !important;
}

.position-block .table-wrap tr:not(.position-row) th {
  background: rgba(255,255,255,0.012) !important;
}

.position-block .table-wrap td.name-cell:not(.employee-color) {
  background-image: linear-gradient(
    180deg,
    rgba(255,255,255,0.016),
    rgba(255,255,255,0.004)
  );
}

.position-block .table-wrap td.name-cell {
  border-right: 1px solid rgba(255,255,255,0.055) !important;
}

.position-block .table-wrap td.name-cell::after,
.position-block .table-wrap th:first-child::after,
.position-block .table-wrap th:first-child::before {
  display: none !important;
  content: none !important;
}

.position-block .table-wrap td.name-cell:not(.employee-color)::before {
  display: none !important;
  content: none !important;
}

.position-block .table-wrap,
.position-block .table-wrap table,
.position-block .table-wrap tr,
.position-block .table-wrap td.name-cell,
.position-block .table-wrap th:first-child {
  background-clip: border-box !important;
}

/* ==================== STATUSES ==================== */

.assigned {
  background: var(--manager-bg);
  box-shadow: inset 0 0 0 1px var(--manager-line);
}

.preferred {
  background: var(--employee-bg);
  box-shadow: inset 0 0 0 1px var(--employee-line);
}

.day_off {
  background: var(--off-bg);
  box-shadow: inset 0 0 0 1px var(--off-line);
}

.silent {
  background: var(--silent-bg);
  box-shadow: inset 0 0 0 1px var(--silent-line);
}

.no_pref {
  background: var(--auto-bg);
  box-shadow: inset 0 0 0 1px var(--auto-line);
}

.cross_scope {
  background:
    linear-gradient(180deg, rgba(38, 52, 76, 0.96), rgba(25, 36, 55, 0.98));
  box-shadow: inset 0 0 0 1px rgba(126, 162, 220, 0.34);
}

.cross_scope.cross-scope-day-off {
  background: var(--off-bg);
  box-shadow: inset 0 0 0 1px var(--off-line);
}

.cross_scope.cross-scope-source-color {
  background-blend-mode: normal;
}

td.day-cell.cross_scope {
  cursor: pointer;
}

td.day-cell.cross_scope:hover .status-tag.cross-scope {
  transform: translateY(-1px);
  background: rgba(105, 146, 214, 0.28);
  border-color: rgba(163, 195, 246, 0.54);
}

td.day-cell.cross-scope-navigation-target {
  z-index: 8;
  animation: cross-scope-navigation-pulse 1.1s ease-in-out 2;
}

@keyframes cross-scope-navigation-pulse {
  0%, 100% {
    outline: 2px solid rgba(143, 181, 255, 0.86);
    outline-offset: -2px;
    filter: brightness(1.10) saturate(1.06);
  }

  50% {
    outline: 3px solid rgba(255, 220, 110, 0.96);
    outline-offset: -3px;
    transform: translateY(-1px) scale(1.01);
    filter: brightness(1.30) saturate(1.16) drop-shadow(0 0 10px rgba(255, 205, 74, 0.40));
  }
}

@media (prefers-reduced-motion: reduce) {
  td.day-cell.cross-scope-navigation-target {
    animation: none;
    outline: 3px solid rgba(255, 220, 110, 0.96);
    outline-offset: -3px;
  }
}

.cell-main {
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 3px;
  line-height: 1.1;
  color: var(--text);
}

.cell-sub {
  font-size: 10px;
  color: #d0dbeb;
  line-height: 1.15;
  min-height: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  word-break: break-word;
  white-space: normal;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 9px;
  margin-top: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #eef4ff;
  line-height: 1;
  white-space: nowrap;
}

.status-tag.manager {
  background: rgba(91, 141, 239, 0.16);
  color: #d6e5ff;
  border-color: rgba(91, 141, 239, 0.26);
}

td.day-cell.saving-cell {
  cursor: progress;
  box-shadow:
    inset 0 0 0 1px rgba(143, 181, 255, 0.26);
}

.inline-saving-tag {
  color: #dce9ff;
  border-color: rgba(143, 181, 255, 0.34);
  background: rgba(91, 141, 239, 0.18);
}

.inline-saved-tag {
  color: #dcfce7;
  border-color: rgba(74, 222, 128, 0.34);
  background: rgba(34, 197, 94, 0.16);
}

td.day-cell.just-saved-cell {
  box-shadow:
    inset 0 0 0 2px rgba(74, 222, 128, 0.42),
    inset 0 0 24px rgba(34, 197, 94, 0.10);
}

.status-tag.employee {
  background: rgba(111, 185, 131, 0.16);
  color: #dcf4e2;
  border-color: rgba(111, 185, 131, 0.26);
}

.status-tag.off {
  background: rgba(210, 106, 120, 0.16);
  color: #ffd4da;
  border-color: rgba(210, 106, 120, 0.26);
}

.status-tag.auto {
  background: rgba(201, 167, 74, 0.16);
  color: #f8e6b1;
  border-color: rgba(201, 167, 74, 0.26);
}

.status-tag.silent-tag {
  background: rgba(255, 255, 255, 0.045);
  color: #c1ccdc;
}

.status-tag.cross-scope {
  background: rgba(105, 146, 214, 0.18);
  color: #dceaff;
  border-color: rgba(133, 174, 239, 0.34);
}

.cell-related-hint {
  margin: 4px auto 1px;
  padding: 3px 6px;
  max-width: calc(100% - 8px);
  border: 1px solid rgba(133, 174, 239, 0.22);
  border-radius: 7px;
  background: rgba(14, 25, 43, 0.32);
  color: rgba(225, 237, 255, 0.90);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cross-scope-menu-note {
  padding: 9px 10px;
  color: #dce9ff;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  white-space: pre-line;
  border: 1px solid rgba(133, 174, 239, 0.24);
  border-radius: 8px;
  background: rgba(74, 112, 174, 0.12);
}

td.day-cell.cell-color {
  color: #f8fbff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

td.day-cell.cell-color .cell-main {
  color: #ffffff;
}

td.day-cell.cell-color .cell-sub {
  color: rgba(244, 248, 255, 0.88);
}

td.day-cell.cell-color .status-tag {
  color: rgba(255, 255, 255, 0.96);
  background: rgba(8, 14, 24, 0.20);
  border-color: rgba(255, 255, 255, 0.20);
}

/* Concept/position colors are the same source of truth as in the PNG. */
td.day-cell.position-color-cell {
  background: var(--position-cell-bg);
  color: var(--position-cell-text);
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 0 0 1px var(--position-cell-border);
}

td.day-cell.position-color-cell .cell-main {
  color: var(--position-cell-text);
}

td.day-cell.position-color-cell .cell-sub {
  color: var(--position-cell-muted);
}

td.day-cell.position-color-cell .status-tag {
  color: var(--position-cell-text);
  background: var(--position-cell-overlay);
  border-color: color-mix(in srgb, var(--position-cell-text) 24%, transparent);
}

.schedule-table,
.schedule-table th,
.schedule-table td,
.schedule-table .cell-main,
.schedule-table .cell-sub,
.schedule-table .status-tag,
.schedule-table .name,
.schedule-table .subname {
  user-select: none;
  -webkit-user-select: none;
}

.schedule-table .cell-inline-input {
  user-select: text;
  -webkit-user-select: text;
}

td.day-cell.sheet-selected {
  position: relative;
  box-shadow:
    inset 0 0 0 2px rgba(125, 180, 255, 0.90),
    inset 0 0 0 999px rgba(96, 165, 250, 0.10) !important;
}

td.day-cell.sheet-anchor {
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.92),
    inset 0 0 0 999px rgba(96, 165, 250, 0.14) !important;
}

/* ==================== HOVER / SELECTED ==================== */

tr {
  transition: transform 0.16s ease, filter 0.16s ease;
}

td.name-cell,
td.day-cell {
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    filter 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease;
  will-change: transform;
}

td.day-cell.cell-patch-instant,
td.day-cell.cell-patch-instant .cell-main,
td.day-cell.cell-patch-instant .cell-sub,
td.day-cell.cell-patch-instant .status-tag {
  transition: none !important;
  animation: none !important;
}

tr:hover td.name-cell {
  filter: brightness(1.02);
}

tr:hover td.day-cell:not(.selected) {
  filter: brightness(1.015);
}

td.name-cell:hover {
  filter: brightness(1.02);
}

td.day-cell:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 8px 16px rgba(0, 0, 0, 0.14);
  z-index: 3;
}

td.day-cell.selected {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 2px var(--accent-2),
    0 10px 18px rgba(91, 141, 239, 0.16);
  z-index: 5;
}

td.day-cell.day-highlight {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    inset 0 0 16px rgba(255, 255, 255, 0.03),
    inset 0 0 0 9999px rgba(255, 255, 255, 0.02);
}

/* ==================== CROSS HIGHLIGHT ==================== */

tr.row-active td.name-cell {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  filter: brightness(1.03);
}

td.name-cell.row-highlight {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 0 9999px rgba(255, 255, 255, 0.02) !important;
}

td.name-cell.selected-name {
  box-shadow:
    inset 0 0 0 1px rgba(91, 141, 239, 0.24),
    inset 0 0 0 9999px rgba(91, 141, 239, 0.08) !important;
}

td.name-cell.employee-color.row-highlight,
td.name-cell.employee-color.selected-name,
tr.row-active td.name-cell.employee-color {
  filter: brightness(1.08);
}

td.day-cell.row-highlight:not(.selected) {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 9999px rgba(255, 255, 255, 0.014);
}

td.day-cell.col-highlight:not(.selected) {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 0 16px rgba(255, 255, 255, 0.03),
    inset 0 0 0 9999px rgba(255, 255, 255, 0.02);
}

th.col-highlight {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 9999px rgba(255, 255, 255, 0.02);
}

th.selected-col {
  box-shadow:
    inset 0 0 0 1px rgba(91, 141, 239, 0.22),
    inset 0 -2px 0 rgba(91, 141, 239, 0.85),
    inset 0 0 0 9999px rgba(91, 141, 239, 0.06);
}

/* ==================== TABLE FOCUS UX ==================== */

tr.row-active td.day-cell:not(.selected) {
  filter: brightness(1.055) saturate(1.04);
}

tr.row-active td.day-cell.row-highlight:not(.selected) {
  box-shadow:
    inset 0 0 0 1px rgba(122, 165, 255, 0.14),
    inset 0 0 0 9999px rgba(91, 141, 239, 0.035);
}

td.day-cell.col-highlight:not(.selected) {
  filter: brightness(1.035);
}

td.day-cell.selected {
  position: relative;
  outline: 2px solid rgba(143, 181, 255, 0.82);
  outline-offset: -2px;
  filter: brightness(1.12) saturate(1.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 0 24px rgba(122, 165, 255, 0.20),
    0 12px 26px rgba(91, 141, 239, 0.20) !important;
}

td.day-cell.selected::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

td.name-cell.selected-name {
  outline: 2px solid rgba(143, 181, 255, 0.74);
  outline-offset: -2px;
  filter: brightness(1.11) saturate(1.05);
}

td.name-cell.selected-name .name {
  color: #ffffff;
}

td.name-cell.selected-name .sub-chip {
  border-color: rgba(143, 181, 255, 0.28);
  background: rgba(91, 141, 239, 0.12);
}

th.selected-col {
  color: #ffffff;
  text-shadow: 0 0 14px rgba(122, 165, 255, 0.30);
}

th.selected-col::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(143, 181, 255, 0.95), transparent);
}

.day-cell .cell-main,
.day-cell .cell-sub,
.day-cell .status-tag {
  transition:
    color 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease,
    border-color 180ms ease;
}

td.day-cell.selected .cell-main {
  transform: translateY(-1px);
}

td.day-cell.selected .status-tag {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.11);
}

td.day-cell.silent:not(.selected) {
  background:
    linear-gradient(180deg, rgba(17, 25, 38, 0.98), rgba(12, 18, 28, 0.98));
}

td.day-cell.assigned:not(.selected),
td.day-cell.preferred:not(.selected),
td.day-cell.day_off:not(.selected),
td.day-cell.no_pref:not(.selected) {
  background-blend-mode: screen;
}

/* ==================== STICKY POLISH ==================== */

th:first-child {
  box-shadow: none !important;
}

td.name-cell:not(.employee-color):not(.row-highlight):not(.selected-name) {
  box-shadow: none !important;
}

/* ==================== FOCUS ==================== */

td.day-cell:focus-visible,
td.name-cell:focus-visible,
th:focus-visible {
  outline: 2px solid rgba(122, 165, 255, 0.95);
  outline-offset: -2px;
}

/* ==================== ROUNDED INNER POSITION BLOCK ==================== */

.position-block {
  border-radius: 0 !important;
  overflow: hidden !important;
}

.position-block .table-wrap {
  border-radius: 0 !important;
  overflow: hidden !important;
}

.position-block table {
  border-collapse: separate;
  border-spacing: 0;
}

.position-block tr.position-row th {
  border-radius: 0 !important;
}

.position-block tr.position-row + tr th:first-child {
  border-top-left-radius: 0 !important;
}

.position-block tr.position-row + tr th:last-child {
  border-top-right-radius: 0 !important;
}

.position-block tr:last-child td:first-child {
  border-bottom-left-radius: 14px !important;
}

.position-block tr:last-child td:last-child {
  border-bottom-right-radius: 14px !important;
}

/* Short, compositor-friendly feedback for local schedule mutations. */
td.day-cell.cell-slot-added {
  animation: schedule-cell-slot-added 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

td.day-cell.cell-slot-removed {
  animation: schedule-cell-slot-removed 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.schedule-table tr.schedule-row-removing {
  pointer-events: none;
  transform-origin: left center;
  animation: schedule-row-remove 190ms cubic-bezier(0.4, 0, 1, 1) both !important;
}

@keyframes schedule-cell-slot-added {
  0% {
    opacity: 0.58;
    transform: scale(0.975);
    box-shadow: inset 0 0 0 2px rgba(74, 222, 128, 0.08);
  }
  58% {
    opacity: 1;
    transform: scale(1.008);
    box-shadow: inset 0 0 0 2px rgba(74, 222, 128, 0.44);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes schedule-cell-slot-removed {
  0% {
    opacity: 0.56;
    transform: scale(0.982);
    box-shadow: inset 0 0 0 2px rgba(125, 180, 255, 0.16);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes schedule-row-remove {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-8px) scale(0.992);
  }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
  td.name-cell,
  td.day-cell,
  tr {
    transition: none !important;
    transform: none !important;
  }

  td.day-cell.cell-slot-added,
  td.day-cell.cell-slot-removed,
  .schedule-table tr.schedule-row-removing {
    animation: none !important;
  }
}

/* Large schedule performance: keep selection visible, avoid repaint-heavy motion. */
.schedule-table tr,
.schedule-table td.name-cell,
.schedule-table td.day-cell {
  transition: none !important;
  will-change: auto !important;
}

.schedule-table th,
.schedule-table td.name-cell,
.schedule-table td.name-cell.employee-color {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.schedule-table td.day-cell:hover,
.schedule-table td.day-cell.selected {
  transform: none !important;
}

.schedule-table tr:hover td.name-cell,
.schedule-table tr:hover td.day-cell:not(.selected),
.schedule-table td.name-cell:hover,
.schedule-table td.day-cell.col-highlight:not(.selected),
.schedule-table tr.row-active td.day-cell:not(.selected),
.schedule-table td.name-cell.selected-name,
.schedule-table td.name-cell.employee-color.row-highlight,
.schedule-table td.name-cell.employee-color.selected-name,
.schedule-table tr.row-active td.name-cell.employee-color {
  filter: none !important;
}
