.dashboard-grid {
  width: 90%;
  align-self: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: white;
  justify-content: start;
  align-items: center;

  .dashboard-content {
    display: flex;
    flex-direction: column;
    height: 94%;
    width: 90%;
    background-color: white;
    justify-content: space-between;

    .container-dashboard {
      background-color: white;
      padding: 0px 40px;
    }
  }

  .header-dashboard {
    display: flex;
    align-items: center;
    padding: 20px 0px;

    .actions {
      width: 65%;
      display: flex;
      flex-direction: row;
      align-items: center;

      .container-btns {
        display: flex;
        width: fit-content;
        align-items: center;
        width: 30%;

        &.p-0 {
          margin-bottom: 0px;
        }

        &.ml-2 {
          margin-left: 2rem;
        }

        .custom-file-input-display {
          display: flex;
          align-items: center;
          gap: 10px;

          .file-name-text {
            font-size: 15px;
          }
        }

        .choose-file {
          padding: 3px 6px;
          cursor: pointer;
          min-width: 110px;
        }

        .file-name {
          margin-top: 15px;
          font-size: 15px;
          color: #555;
          min-height: 20px;
        }
      }
    }
  }

  .arrow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
  }

  .first-row {
    position: relative;
    height: auto;

    .time-label {
      width: 100%;
      font-size: 18px;
      font-weight: 500;
      align-self: baseline;
      display: flex;
      align-items: center;
      justify-content: center;
      padding-bottom: 20px;
    }

    .four-block {
      align-self: flex-end;
    }

    .third-block {
      height: 100%;
      width: 75%;
      display: flex;
      flex-direction: column;

      .container-e {
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: end;
      }

      .container-cd {
        display: flex;
        flex-direction: row;
        align-items: end;
        justify-content: space-between;
        width: 100%;

        .block-d {
          width: 75%;
        }
      }

      .endpoint {
        width: 20px;
        height: 35px;
      }

      .container-empty {
        height: 24px;
        display: flex;
        justify-content: flex-start;
        width: 100%;
        position: relative;
      }

      .second-block {
        width: 100%;
        display: flex;
        flex-direction: row;

        .container-cd {
          display: flex;
          flex-direction: row;
          align-items: end;
          justify-content: space-between;
          width: 100%;

          .block-d {
            width: 75%;
          }
        }
      }
    }
  }

  .second-row {
    margin-top: 24px;
    height: auto;

    .container-report {
      display: flex;
      width: 75%;
      justify-content: space-between;
    }
  }

  .footer {
    display: flex;
    justify-content: space-between;
    align-items: end;
    padding: 40px;

    .report-container {
      width: 35%;
      height: auto;

      .report-content {
        background: #C8D2DC;
        border: 1px solid #cce;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
          0 6px 20px 0 rgba(0, 0, 0, 0.19);
        padding: 15px 15px 10px 15px;
        margin-top: 15px;
      }
    }

    .controls {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      align-items: center;
      margin-bottom: 16px;
      gap: 10px;

      .date-picker {
        width: 100%;
        display: flex;
        align-items: center;
      }

      input[type="date" i] {
        padding: 10px 25px;
        border: none;
        border-radius: 5px;
        font-size: 14px;
      }

      button {
        padding: 10px 15px;
        border: none;
        border-radius: 5px;
      }

      .search-data {
        margin-left: 15px;
        padding: 8px 10x;
      }

      .download-btn {
        min-width: 115px;
      }
    }

    .container-lists {
      width: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      height: 220px;

      .report-date-title {
        display: flex;
        align-items: center;
        height: 40px;
        border-bottom: 1px dashed #555;
        font-size: 14px;
        font-weight: bold;
        background-color: white;
        padding: 0 15px;
        max-height: 40px;

        .value-date {
          padding-left: 20px;
        }
      }
    }

    #itemList {
      list-style: none;
      padding: 0 15px;
      margin: 0;
      background-color: white;
      min-height: 179px;
    }

    #itemList li {
      display: flex;
      padding: 8px 0;
      border-bottom: 1px solid #eef;
      flex-direction: column;
      font-size: 15px;
      font-weight: 500;

      .details-content {
        display: flex;
        flex-direction: column;
        padding: 2px 15px;
      }
    }

    #itemList li:last-child {
      border-bottom: none;
    }

    .suggestion-wrapper {
      display: flex;
      flex-direction: column;
      gap: 0px;
    }

    .suggestion {
      display: flex;
      flex-direction: column;
      justify-content: end;
      padding: 0 5px;

      span {
        margin-left: 5px;
      }

      textarea {
        height: 267px;
        margin-top: 15px;
        line-height: 25px;
        max-width: 95%;
        margin-left: 5px;
        font-size: 15px;
        font-weight: 500;
        width: 570px;
        padding: 15px;
      }

      .current-issue-display {
        height: 267px;
        margin-top: 15px;
        line-height: 25px;
        max-width: 95%;
        margin-left: 5px;
        font-size: 15px;
        font-weight: 500;
        width: 570px;
        padding: 15px;
        overflow-y: auto;
        border: 1px solid #ccc;
        border-radius: 4px;
        background-color: #fff;
        white-space: pre-wrap;
        word-wrap: break-word;

        &:empty::before {
          content: attr(data-placeholder);
          color: #999;
        }

        .chat-item {
          margin-bottom: 10px;
          padding: 8px 10px;
          border-radius: 5px;

          &:last-child {
            margin-bottom: 0;
            padding-bottom: 8px;
          }

          &.newest-message {
            background-color: transparent;

            .user-msg {
              color: #2c3e50;
              font-weight: 600;
            }

            .assistant-msg {
              color: #000;
            }
          }

          &.old-message {
            background-color: #e8e8e8;

            .user-msg,
            .assistant-msg {
              color: #333;
            }
          }

          .user-msg,
          .assistant-msg {
            display: block;
            margin-bottom: 5px;
            line-height: 1.4;

            &:last-child {
              margin-bottom: 0;
            }
          }

          .msg-label {
            font-weight: 700;
            margin-right: 5px;
          }
        }

        .separator {
          text-align: center;
          color: #ccc;
          margin: 10px 0;
          font-size: 12px;
          line-height: 1;
        }

        .history-separator {
          text-align: center;
          color: #999;
          margin: 12px 0;
          font-size: 12px;
          line-height: 1;
          padding: 4px 0;
        }

        &::-webkit-scrollbar {
          width: 8px;
        }

        &::-webkit-scrollbar-track {
          background: #f1f1f1;
          border-radius: 4px;
        }

        &::-webkit-scrollbar-thumb {
          background: #888;
          border-radius: 4px;

          &:hover {
            background: #555;
          }
        }
      }
    }

    .chat-input-section {
      display: flex;
      flex-direction: column;
      padding: 0 5px;
      margin-top: 15px;

      .chat-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-left: 5px;
        margin-bottom: 10px;

        .title-box {
          margin: 0;
        }

        .clear-history-btn {
          background: none;
          border: none;
          cursor: pointer;
          padding: 5px;
          color: #666;
          transition: color 0.3s;
          display: flex;
          align-items: center;

          &:hover {
            color: #e74c3c;
          }

          svg {
            width: 16px;
            height: 16px;
          }
        }
      }

      .chat-input {
        height: 40px;
        padding: 10px 15px;
        margin-left: 5px;
        font-size: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        width: 570px;
        max-width: 95%;
        height: 50px;
        outline: none;
        transition: border-color 0.3s;

        &:focus {
          border-color: #4a90e2;
        }

        &::placeholder {
          color: #999;
        }
      }
    }

    .actions {
      display: flex;
      flex-direction: column;
      align-items: start;
      justify-content: space-between;
      height: 88%;

      .mark-container {
        display: flex;
        flex-direction: column;
        align-items: start;
        gap: 15px;

        .mark-button {
          padding: 15px 25px;
          min-width: 125px;
          min-height: 45px;
        }
      }
    }

    .report {
      padding: 15px 25px;
    }

    .search {
      cursor: pointer;
      padding: 15px 25px;
    }

    .search-icon {
      width: 20px;
      height: 20px;
      margin-right: 5px;
    }
  }

  .row-center {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: end;

    &.second-row {
      align-items: start;
    }
  }

  .common-col {
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: center;
  }

  .section {
    width: 100%;

    &.common-block {
      display: flex;
      flex-direction: column;
      width: auto;
    }

    &.d2 {
      width: 56%;
    }

    &.m-1 {
      margin-top: 16px;
    }

    &.m-2 {
      margin-top: 16px;
    }
  }

  .stage {
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }

  .stage-label {
    font-weight: bold;
    width: 100%;
    height: 100%;
    background-color: #888;
    color: white;
    line-height: 30px;
    border: solid 2px black;
    text-indent: 5px;
    cursor: pointer;

    &.empty {
      height: 54px;
      width: 35px;
      position: absolute;
      top: 0;
      left: 0;
      cursor: auto;
    }
  }

  .stage-label:hover {
    opacity: 0.8;

    &.empty {
      opacity: 1;
    }
  }

  .boxes {
    display: flex;
    gap: 30px;
    width: 100%;
    justify-content: flex-end;

    &.f-box {
      flex-direction: row;
      justify-content: flex-end;
      gap: 0;
    }

    .f-middle {
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
  }

  .col-custom {
    justify-content: flex-end;
  }

  .row-custom {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    &.space {
      gap: 35px;
    }

    &.middle {
      height: 100%;
    }

    &.legend-row {
      width: 100%;
      justify-content: flex-end;
      margin-bottom: 32px;
    }
  }

  .legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #fff;

    .text {
      font-weight: bold;
      font-size: 16px;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .legend-color {
      width: 15px;
      height: 15px;
      border: 1px solid #333;
    }

    .legend-green {
      background: #96d596;
    }

    .legend-yellow {
      background: #f6f86c;
    }

    .legend-red {
      background: #c71717;
    }

  }

  .box {
    border: 2px solid #222;
    border-radius: 4px;
    padding: 2px 12px;
    background: #96d596;
    color: #222;
    font-weight: bold;
    min-width: 45px;
    text-align: center;
    cursor: default;

    &.NG {
      cursor: pointer;
    }
  }

  .box.dang-dung {
    background: #f6f86c;
  }

  .box.error {
    background: #c71717;
  }

  .arrow {
    font-size: 24px;
    margin: 0 12px;
  }


  tr:nth-child(even) {
    background-color: #f9f9f9;
  }

  tr:hover {
    background-color: #f1f1f1;
  }

  .chart-card {
    grid-column: 1 / -1;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    width: 250px;
    margin-top: 10px;
  }

  .chart-card h3 {
    margin-bottom: 20px;
    color: var(--text-color);
  }

  .chart-card canvas {
    max-width: 100%;
    max-height: 100%;
    background-color: var(--background-common);
  }

  .item-steps {
    font-weight: bold;
  }
}

/* Styles for screens larger than 1024px (e.g., desktops) */
@media only screen and (min-width: 992px) {
  .boxes {
    gap: 20px;
  }

  .container-report {
    width: 60%;
  }

  .dashboard-grid {
    width: 85%;
  }
}

/* Styles for screens larger than 1024px (e.g., desktops) */
@media only screen and (min-width: 1280px) {
  .boxes {
    gap: 20px;
  }

  .container-report {
    width: 60%;
  }

  .dashboard-grid {
    width: 85%;
  }
}

@media only screen and (max-width: 1900px) {
  .dashboard-grid {
    .dashboard-content {
      .footer {
        .suggestion-wrapper {
          .suggestion {
            .textarea {
              height: 180px;
            }
          }
        }
      }
    }

    .second-row {
      .container-report {
        width: 75%;
      }
    }
  }
}