
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: block;
}

.add-forecast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  flex-shrink: 0;
  height: 38px;
  padding: 0 18px;
  background: #834DD0;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(131, 77, 208, 0.25);

  mat-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #ffffff;
  }

  &:hover {
    background: #7340bd;
    box-shadow: 0 4px 10px rgba(131, 77, 208, 0.35);
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(131, 77, 208, 0.2);
  }

  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(131, 77, 208, 0.3);
  }
}

/* Icons Container */
.icons {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  width: 227px;
  height: 40px;
}

.action {
  display: flex;
  gap: 24px;
}

/* Modal Content Wrapper */
.modal-content-wrapper {
  position: relative;
  margin: 5% auto;
  width: 735px;
  max-height: 85vh;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 24px;
  gap: 20px;
  opacity: 1;
  max-height: 565px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-top: 65px;
}

/* Title Container */
.title.container {
  width: 687px !important;
  height: 40px !important;
}

.buttfilter {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 18px;
  line-height: 150%;
  letter-spacing: 0%;
  margin: 0;
  color: #333333;
}

/* Save Button */
.save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 40px;
  border-radius: 8px;
  background: #1EAE8A;
  cursor: pointer;
  transition: all 0.3s ease;

  mat-icon {
    color: #ffffff;
    font-size: 20px;
    width: 22px;
    height: 22px;
  }

  &:hover {
    background: #189b7a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 174, 138, 0.3);
  }

  &:active {
    transform: translateY(0);
  }
}

/* Delete Button */
.delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #E63946;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;

  mat-icon {
    color: #E63946;
    font-size: 20px;
    width: 20px;
    height: 20px;
  }

  &:hover {
    background: rgba(230, 57, 70, 0.1);
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(0);
  }
}

/* Add Button (in modal) */
.add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #818181;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;

  mat-icon {
    color: #818181;
    font-size: 20px;
    width: 20px;
    height: 20px;
  }

  &:hover {
    background: rgba(129, 129, 129, 0.1);
    border-color: #666666;
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(0);
  }
}

/* Close Icon */
.closeicon {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  margin-left: 16px;

  mat-icon {
    width: 27px;
    height: 27px;
    font-size: 27px;
    color: #666666;
  }

  &:hover {
    transform: scale(1.1);

    mat-icon {
      color: #333333;
    }
  }
}

/* Detail Section Title */
.Detail {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0%;
  color: #834DD0;
  margin: 16px 0 12px 0;
}

/* Adjacent Fields */
.adjacentField {
  display: inline-block;
  margin-right: 12px;
  margin-bottom: 12px;
  vertical-align: top;
}

/* Item Code / Read-only Display */
.emp-code {
  font-size: 14px;
  color: #666666;
  margin: 0;
  padding: 8px 0;
  font-weight: 500;
}

/* Form Overview */
.FormOverView {
  padding: 20px;
}

/* Staged stations grid (below the form, shown after first Add) */
.FormOverView > div[ng-reflect-ng-if],
.FormOverView > div:has(gb-formgrid) {
  margin-top: 20px;
}

/* Scrollbar Styling */
.scrollbar::-webkit-scrollbar {
  width: 8px;
}

.scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.scrollbar::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.scrollbar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Consume Quantity Display */
.adjacentField[style*="flex-direction: column"] {
  label {
    font-size: 12px;
    color: #666666;
    margin-bottom: 4px;
    font-weight: 500;
  }

  span {
    font-size: 16px;
    font-weight: 600;
    color: #834DD0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-content-wrapper {
    width: 95%;
    margin: 2% auto;
  }

  .add-forecast-btn {
    width: auto;
    min-width: 140px;
  }

  .icons {
    gap: 4px;
    margin-left: auto;
  }

  .action {
    gap: 4px;
  }

  .save,
  .delete,
  .add {
    width: 40px;
    height: 36px;

    mat-icon {
      font-size: 18px;
      width: 18px;
      height: 18px;
    }
  }

  .closeicon {
    margin-left: 8px;

    mat-icon {
      width: 24px;
      height: 24px;
      font-size: 24px;
    }
  }
}

/* Focus States for Accessibility */
.add-forecast-btn:focus-visible,
.save:focus-visible,
.delete:focus-visible,
.add:focus-visible,
.closeicon:focus-visible {
  outline: 2px solid #834DD0;
  outline-offset: 2px;
}

/* ---- Station Membership (current assignments on the selected line) ---- */
.station-membership {
  margin-top: 28px;
  border-top: 1px solid #eeeeee;
  padding-top: 18px;
}

.station-membership__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.station-membership__title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #834DD0;
  text-transform: uppercase;
}

.station-membership__empty {
  color: #999999;
  font-size: 13px;
  padding: 12px 0;
}

.station-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e5f4ee;
  background: #f4fbf8;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: box-shadow 0.15s ease;

  &:hover {
    box-shadow: 0 2px 8px rgba(30, 174, 138, 0.12);
  }
}

.station-row__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1EAE8A;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.station-row__info {
  flex: 1;
}

.station-row__name {
  font-weight: 600;
  color: #333333;
  font-size: 14px;
}

.station-row__code {
  font-size: 12px;
  color: #1EAE8A;
}

.station-row__dates {
  font-size: 12px;
  color: #666666;
  white-space: nowrap;
}

.station-row__current {
  font-size: 11px;
  font-weight: 700;
  color: #1EAE8A;
  background: rgba(30, 174, 138, 0.12);
  border-radius: 12px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* ---- Two-column layout: line sidebar (left) + selected line detail (right) ---- */
.pl-layout {
  display: flex;
  align-items: flex-start;
}

.pl-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding-right: 24px;
  border-right: 1px solid #eeeeee;
}

.pl-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #333333;
  margin-bottom: 12px;
}

.pl-sidebar__add {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #834DD0;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(131, 77, 208, 0.35);
  transition: all 0.2s ease;

  mat-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
  }

  &:hover {
    background: #7340bd;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(131, 77, 208, 0.4);
  }
}

.pl-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
}

.pl-sidebar__empty {
  color: #999999;
  font-size: 13px;
  padding: 8px 0;
}

.pl-line-card {
  border: 1px solid #eaeaea;
  border-left: 4px solid var(--line-accent, #834DD0);
  border-radius: 10px;
  padding: 12px 12px 12px 14px;
  background: color-mix(in srgb, var(--line-accent, #834DD0) 5%, #ffffff);
  cursor: pointer;
  transition: all 0.2s ease;

  &:hover {
    box-shadow: 0 3px 10px color-mix(in srgb, var(--line-accent, #834DD0) 25%, transparent);
    transform: translateY(-1px);
  }
}

.pl-line-card--active {
  background: color-mix(in srgb, var(--line-accent, #834DD0) 10%, #ffffff);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--line-accent, #834DD0) 30%, transparent);
}

.pl-line-card--inactive {
  opacity: 0.55;
}

.pl-line-card__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-line-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pl-line-card__name {
  font-weight: 600;
  font-size: 14px;
  color: #333333;
  flex: 1;
}

.pl-line-card__ws-count {
  font-size: 11px;
  font-weight: 600;
  color: color-mix(in srgb, var(--line-accent, #834DD0) 70%, black);
  background: color-mix(in srgb, var(--line-accent, #834DD0) 14%, #ffffff);
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

.pl-line-card__status {
  font-size: 11px;
  font-weight: 700;
  color: #999999;
  background: #f1f1f1;
  border-radius: 12px;
  padding: 2px 10px;

  &.is-active {
    color: #1EAE8A;
    background: rgba(30, 174, 138, 0.12);
  }
}

.pl-line-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  margin-left: 16px;
}

.ws-chip {
  font-size: 11px;
  font-weight: 500;
  background: color-mix(in srgb, var(--line-accent, #834DD0) 12%, #ffffff);
  color: color-mix(in srgb, var(--line-accent, #834DD0) 75%, black);
  border: 1px solid color-mix(in srgb, var(--line-accent, #834DD0) 20%, transparent);
  border-radius: 10px;
  padding: 2px 8px;
}

.pl-detail {
  flex: 1;
  min-width: 0;
  padding-left: 28px;
}

.pl-detail__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #834DD0;
  margin-bottom: 14px;
}

.selected-line-label {
  font-size: 13px;
  color: #666666;
  margin-bottom: 12px;

  strong {
    color: #333333;
  }
}