.schedule-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.schedule-predecessor-select {
  height: auto;
  min-height: 96px;
}
.form-hint {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}
.schedule-heading-actions,
.schedule-filters,
.schedule-view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.schedule-import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  cursor: pointer;
}
.schedule-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.schedule-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.schedule-summary span {
  color: var(--text-muted);
  font-size: 11px;
}
.schedule-summary strong {
  font-size: 16px;
  font-weight: 700;
}
.schedule-summary .schedule-late {
  color: var(--red);
}
.schedule-shell {
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.schedule-filters {
  flex-wrap: wrap;
}
.schedule-filters .select-sm {
  min-width: 140px;
  max-width: 220px;
}
.schedule-search {
  width: 210px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card2);
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
}
.schedule-search:focus {
  outline: 1px solid var(--accent);
}
.schedule-zoom {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.schedule-zoom button {
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.schedule-zoom button.active {
  background: var(--accent);
  color: #fff;
}
.schedule-view-controls .btn-outline {
  padding: 6px 10px;
  min-height: 32px;
}
.schedule-nav {
  font-size: 19px;
  line-height: 1;
}
.schedule-scroll {
  overflow: auto;
  max-height: min(68vh, 760px);
  min-height: 260px;
  scrollbar-color: var(--border-light) transparent;
  scrollbar-width: thin;
}
.schedule-grid-header,
.schedule-grid-row,
.schedule-phase-row {
  display: grid;
  grid-template-columns: var(--schedule-columns);
  width: max-content;
  min-width: 100%;
  align-items: stretch;
}
.schedule-grid-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 48px;
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}
.schedule-grid-header > div:not(.schedule-timeline-head) {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-right: 1px solid var(--border);
}
.schedule-timeline-head {
  position: relative;
  display: flex;
  overflow: hidden;
  background-image: linear-gradient(
    to right,
    transparent calc(100% - 1px),
    var(--border) calc(100% - 1px)
  );
  background-repeat: repeat-x;
}
.schedule-day-head {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-right: 1px solid rgba(128, 128, 128, 0.11);
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}
.schedule-day-head.week-start,
.schedule-day-head.month-start {
  border-left: 1px solid var(--border-light);
  color: var(--text-primary);
  font-weight: 700;
}
.schedule-grid-row {
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.schedule-grid-row:hover {
  background: rgba(128, 128, 128, 0.035);
}
.schedule-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 6px 10px;
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-task-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
}
.schedule-task-cell small {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
}
.schedule-edit {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
.schedule-edit:hover {
  color: var(--accent);
}
.schedule-date-cell {
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}
.schedule-track,
.schedule-phase-track {
  position: relative;
  min-height: 48px;
  background-image: linear-gradient(
    to right,
    transparent calc(100% - 1px),
    rgba(128, 128, 128, 0.13) calc(100% - 1px)
  );
  background-repeat: repeat-x;
}
.schedule-bar {
  position: absolute;
  top: 12px;
  height: 24px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 8px;
  border: 1px solid rgba(92, 110, 248, 0.55);
  border-radius: 5px;
  background: rgba(92, 110, 248, 0.24);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.schedule-bar:before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--task-progress);
  background: rgba(92, 110, 248, 0.62);
  content: '';
}
.schedule-bar span {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 600;
}
.schedule-bar.is-complete {
  border-color: rgba(46, 204, 113, 0.58);
  background: rgba(46, 204, 113, 0.2);
}
.schedule-bar.is-complete:before {
  background: rgba(46, 204, 113, 0.52);
}
.schedule-bar.is-late {
  border-color: rgba(231, 76, 60, 0.58);
  background: rgba(231, 76, 60, 0.17);
}
.schedule-bar.is-late:before {
  background: rgba(231, 76, 60, 0.42);
}
.schedule-no-dates {
  color: var(--text-muted);
  font-size: 10px;
}
.schedule-phase-row {
  min-height: 38px;
  background: rgba(128, 128, 128, 0.055);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
}
.schedule-phase-name {
  grid-column: 1/2;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--text-primary);
}
.schedule-phase-name small {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 500;
}
.schedule-phase-caret {
  color: var(--accent);
  font-size: 12px;
}
.schedule-phase-progress {
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--text-muted);
}
.schedule-phase-track {
  grid-column: 3/-1;
  min-height: 38px;
}
.schedule-phase-summary {
  position: absolute;
  top: 16px;
  height: 6px;
  border-radius: 4px;
  background: rgba(92, 110, 248, 0.48);
}
.schedule-today-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 2px;
  background: #f05b50;
  pointer-events: none;
}
.schedule-today-mark:before {
  position: absolute;
  top: 0;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f05b50;
  content: '';
}
.schedule-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 13px;
  color: var(--text-muted);
  font-size: 10px;
}
.schedule-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-bar,
.legend-progress,
.legend-today {
  display: inline-block;
  width: 13px;
  height: 7px;
  border: 1px solid rgba(92, 110, 248, 0.65);
  border-radius: 3px;
  background: rgba(92, 110, 248, 0.3);
}
.legend-progress {
  background: rgba(92, 110, 248, 0.75);
}
.legend-today {
  width: 2px;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: #f05b50;
}
.schedule-loading,
.schedule-error,
.schedule-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.schedule-error {
  color: var(--red);
}
@media (max-width: 900px) {
  .schedule-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .schedule-heading {
    align-items: flex-start;
  }
  .schedule-filters {
    width: 100%;
  }
  .schedule-search {
    flex: 1;
    min-width: 160px;
  }
  .schedule-view-controls {
    width: 100%;
    justify-content: flex-end;
  }
  .schedule-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .schedule-heading {
    flex-direction: column;
  }
  .schedule-heading-actions {
    width: 100%;
  }
  .schedule-heading-actions > * {
    flex: 1;
  }
  .schedule-summary > div {
    padding: 10px;
  }
  .schedule-summary span {
    font-size: 10px;
  }
  .schedule-summary strong {
    font-size: 14px;
  }
  .schedule-view-controls {
    gap: 5px;
  }
  .schedule-view-controls .btn-outline {
    padding: 6px 8px;
  }
  .schedule-legend {
    flex-wrap: wrap;
    gap: 10px;
  }
}
.schedule-task-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.schedule-task-title-row .schedule-edit {
  flex: 1;
  min-width: 0;
}
.schedule-delete-button {
  flex: none;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(231, 76, 60, 0.32);
  border-radius: 5px;
  background: rgba(231, 76, 60, 0.08);
  color: var(--red);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.schedule-delete-button:hover {
  border-color: rgba(231, 76, 60, 0.6);
  background: rgba(231, 76, 60, 0.16);
  color: var(--red);
}
.schedule-work-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
}
.schedule-work-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.schedule-work-card-main {
  display: flex;
  align-items: center;
  gap: 11px;
}
.schedule-work-mark {
  display: grid;
  flex: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(92, 110, 248, 0.14);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}
.schedule-work-card h2,
.schedule-detail-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
}
.schedule-work-card p,
.schedule-detail-heading span {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}
.schedule-work-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  color: var(--text-secondary);
  font-size: 10px;
}
.schedule-work-stats strong {
  color: var(--text-primary);
}
.schedule-work-stats small {
  grid-column: 1/-1;
  color: var(--text-muted);
  font-size: 10px;
}
.schedule-work-card > .btn-outline {
  align-self: flex-start;
}
.schedule-work-empty {
  display: flex;
  grid-column: 1/-1;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 52px 18px;
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.schedule-work-empty strong {
  color: var(--text-primary);
  font-size: 15px;
}
.schedule-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
}
.schedule-detail-heading > div:first-child {
  min-width: 0;
}
.schedule-detail-heading h2 {
  overflow-wrap: anywhere;
}
.schedule-work-dialog {
  width: min(440px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}
.schedule-work-dialog::backdrop {
  background: rgba(0, 0, 0, 0.48);
}
.schedule-work-dialog form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.schedule-work-dialog h2 {
  margin: 0 0 4px;
  font-size: 17px;
}
.schedule-work-dialog label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}
.schedule-work-dialog label span {
  color: var(--text-muted);
  font-weight: 400;
}
.schedule-work-dialog input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card2);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}
.schedule-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
#schedule-work-list[hidden],
#schedule-detail[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .schedule-detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .schedule-detail-heading .schedule-heading-actions {
    flex-wrap: wrap;
  }
  .schedule-work-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
.schedule-export {
  position: relative;
}
.schedule-export > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  list-style: none;
  cursor: pointer;
}
.schedule-export > summary::-webkit-details-marker {
  display: none;
}
.schedule-export > summary:after {
  content: '▾';
  font-size: 10px;
}
.schedule-export[open] > summary:after {
  content: '▴';
}
.schedule-export-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 178px;
  padding: 5px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}
.schedule-export-menu button {
  padding: 9px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.schedule-export-menu button:hover {
  background: var(--bg-card2);
  color: var(--accent);
}
