.scheduler-page {
  width: 100%;
  min-height: 100%;
  padding: 6px;
  background: var(--surface);
  color: var(--text);
}

.scheduler-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scheduler-toolbar h2 {
  font-size: 25px;
  line-height: 1.2;
}

.scheduler-toolbar p {
  margin-top: 7px;
  color: var(--text-muted);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
}

.status-live {
  background: #e9f8f1;
  color: #168458;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.scheduler-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.scheduler-main {
  min-width: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 17px;
  box-shadow: var(--shadow-sm);
}

.summary-card-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--primary-subtle);
  color: var(--primary);
}

.summary-card-icon svg {
  width: 21px;
  height: 21px;
}

.summary-card > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.summary-card-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.summary-card strong {
  margin-top: 2px;
  font-size: 22px;
}

.summary-card small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-card,
.resource-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.schedule-card-header,
.resource-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}

.schedule-card-header h3,
.resource-panel-header h3 {
  font-size: 15px;
}

.schedule-card-header p,
.resource-panel-header p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.schedule-view-switcher {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-muted);
  padding: 3px;
}

.schedule-view-switcher button {
  min-height: 30px;
  border-radius: 5px;
  background: transparent;
  padding: 0 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.schedule-view-switcher button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.timeline-scroll-frame {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}

.timeline-scroll-track {
  min-width: 100%;
}

.timeline-header-track {
  border-bottom: 1px solid var(--border);
  background: var(--timeline-header);
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px;
}

.job-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.job-card-accent {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--primary);
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 17px 15px 20px;
}

.job-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-title-row h4 {
  font-size: 15px;
}

.job-status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
}

.job-status.active {
  background: #e8f8f0;
  color: #168458;
}

.job-status.planning {
  background: #fff4dd;
  color: #a4670c;
}

.job-status.draft {
  background: #edf1f5;
  color: #65748a;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.job-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.job-meta svg {
  width: 14px;
  height: 14px;
}

.job-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.assignment-zone {
  min-width: 0;
  background: var(--surface-muted);
  padding: 14px;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.assignment-zone + .assignment-zone {
  border-left: 1px solid var(--border);
}

.assignment-zone.drag-over {
  background: var(--primary-subtle);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.assignment-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.assignment-zone-header > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assignment-zone-header svg {
  width: 15px;
  height: 15px;
}

.assignment-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
}

.assignment-list {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  gap: 8px;
}

.assignment-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
}

.assignment-chip.dragging,
.resource-card.dragging {
  opacity: 0.45;
}

.assignment-bar {
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
  touch-action: none;
  user-select: none;
}

.assignment-bar.selected {
  filter: saturate(1.04) brightness(1.03);
  transform: translateY(-1px);
}

.assignment-bar.conflict {
  box-shadow:
    0 0 0 2px rgba(220, 38, 38, 0.25),
    0 8px 18px rgba(220, 38, 38, 0.18);
}

.assignment-chip-content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.assignment-chip-content strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-chip-content small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #e8f2ff;
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.worker-avatar.large {
  width: 40px;
  height: 40px;
  font-size: 11px;
}

.asset-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: #fff2dc;
  color: #b36c00;
}

.asset-icon.large {
  width: 40px;
  height: 40px;
}

.asset-icon svg {
  width: 17px;
  height: 17px;
}

.remove-assignment {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
}

.remove-assignment:hover {
  background: #fdeaea;
  color: var(--danger);
}

.remove-assignment svg {
  width: 13px;
  height: 13px;
}

.drop-placeholder {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-subtle);
  font-size: 10px;
}

.drop-placeholder svg {
  width: 15px;
  height: 15px;
}

.resource-sidebar {
  position: sticky;
  top: 0;
}

.resource-panel {
  overflow: hidden;
}

.resource-search {
  height: 39px;
  margin: 14px 14px 10px;
  padding: 0 10px;
}

.resource-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0 14px;
  border-bottom: 1px solid var(--border);
}

.resource-tabs button {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.resource-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.resource-tabs button span {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  background: var(--surface-active);
  color: var(--text-muted);
  font-size: 9px;
}

.resource-list {
  display: flex;
  max-height: calc(100vh - 386px);
  min-height: 260px;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 14px;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  padding: 11px;
  cursor: grab;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.resource-card:hover {
  border-color: #b9c8d8;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.resource-card-content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.resource-card-content strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-card-content > span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-card-content small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--success);
  font-size: 9px;
  font-weight: 600;
}

.availability-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.drag-handle {
  color: var(--text-subtle);
}

.drag-handle svg {
  width: 17px;
  height: 17px;
}

.resource-return-zone {
  display: flex;
  width: calc(100% - 28px);
  align-items: center;
  gap: 10px;
  margin: 0 14px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-muted);
  padding: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.resource-return-zone:not(:disabled):hover {
  border-color: var(--danger);
  background: var(--danger-highlight);
  color: var(--danger);
}

.resource-return-zone:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.resource-return-zone:focus-visible {
  outline: 3px solid var(--primary-focus-ring);
  outline-offset: 2px;
}

.resource-return-zone > svg {
  flex: 0 0 auto;
}

.resource-return-zone div {
  display: flex;
  flex-direction: column;
}

.resource-return-zone strong {
  font-size: 10px;
}

.resource-return-zone span {
  margin-top: 2px;
  font-size: 9px;
}

.resource-empty {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-muted);
  text-align: center;
}

.resource-empty > svg {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  color: var(--text-subtle);
}

.resource-empty strong {
  font-size: 12px;
}

.resource-empty span {
  max-width: 210px;
  margin-top: 5px;
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.5;
}

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 380px;
  border: 1px solid #bce8d4;
  border-radius: 9px;
  background: #edf9f3;
  padding: 12px 14px;
  color: #14734d;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 17px;
  height: 17px;
}

.toast span {
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 1350px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card small {
    white-space: normal;
  }
}

/* DKE visual theme overrides */

.scheduler-page {
  max-width: 1680px;
}

.scheduler-toolbar {
  margin-bottom: 18px;
}

.scheduler-toolbar h2 {
  font-size: 23px;
  letter-spacing: -0.02em;
}

.scheduler-toolbar p {
  margin-top: 4px;
  font-size: 11px;
}

.status-live {
  background: var(--primary-subtle);
  color: var(--primary);
}

.summary-card,
.schedule-card,
.resource-panel,
.job-card {
  border-color: var(--border);
  box-shadow: none;
}

.summary-card {
  border-radius: 11px;
  padding: 15px;
}

.summary-card-icon {
  background: var(--primary-subtle);
  color: var(--primary);
}

.summary-card-label {
  font-size: 10px;
}

.summary-card strong {
  font-size: 20px;
}

.schedule-card,
.resource-panel {
  border-radius: 12px;
}

.schedule-card-header,
.resource-panel-header {
  padding: 16px 18px;
}

.job-card-accent {
  background: var(--primary);
}

.job-status.active {
  background: #ebf8f1;
  color: #168458;
}

.job-status.planning {
  background: var(--primary-subtle);
  color: var(--primary);
}

.assignment-zone.drag-over {
  background: var(--primary-subtle);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.worker-avatar {
  background: var(--primary-subtle);
  color: var(--primary);
}

.asset-icon {
  background: #f2f2f2;
  color: #222222;
}

.resource-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.resource-card:hover {
  border-color: #c8cbd1;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.07);
}

.toast {
  border-color: var(--primary-muted);
  background: var(--primary-subtle);
  color: var(--primary-active);
}
